• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Flipping an NSImage (SOLVED)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Flipping an NSImage (SOLVED)


  • Subject: Re: Flipping an NSImage (SOLVED)
  • From: Heinrich Giesen <email@hidden>
  • Date: Fri, 7 Oct 2005 12:05:03 +0200


On 07.10.2005, at 02:50, Michael Becker wrote:

Actually I did that, already. Here's my code:

NSBitmapImageRep *imageRep = [NSBitmapImageRep
imageRepWithContentsOfFile:path];
NSImage *image = [[NSImage alloc] initWithSize:[imageRep size]];
[image addRepresentation:imageRep];

That did not work. But luckily . . . . .


The code works, it shows exactly what you said (maybe not what you wanted) : the image has a size with respect to the resolution of the ImageRep. If you want to get an image with a size without using the resolution (i.e. with respect to the pixelnumber), use this:

NSImage *image = [[NSImage alloc] initWithSize:
  NSMakeSize( [imageRep pixelsWide, [imageRep pixelsHigh] )];

Try also in Preview.app --> Preferences button:
  Respect image DPI for "Actual Size"
and Preview.app --> Tools --> Get Info : Details

--
Heinrich Giesen
email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: Tracking mouse in Non-active Windows
  • Next by Date: Filter to invert a TIFF image
  • Previous by thread: Re: AddressBook/NSTableView Signal 11 crash
  • Next by thread: Filter to invert a TIFF image
  • Index(es):
    • Date
    • Thread