Re: Flipping an NSImage (even more trouble with size)
Re: Flipping an NSImage (even more trouble with size)
- Subject: Re: Flipping an NSImage (even more trouble with size)
- From: Michael Becker <email@hidden>
- Date: Thu, 6 Oct 2005 21:46:57 +0200
Am 06.10.2005 um 19:11 schrieb Michael Becker:
I am using NSImage's drawInRect:fromRect: method to draw the
portions of the images into the frames. If I call
[currentImage drawInRect:frameRect fromRect:NSMakeRect( 0, 0,
100, 100) ...
the upper left part of the image should be displayed, as the
fromRect:-rectangle starts at the image's (flipped) origin. So far
so good. However, *some* images still seem to have their origin in
the LOWER left corner. In that case, the code snippet I wrote would
draw the LOWER left part of the image into frameRect.
The images I use are various JPEGs coming from all kinds of sources
and I cannot see any obvious reason why some of them would behave
strangely when flipped.
I am not an expert at this flipping thing, but for *most* images it
works, and I cannot even determine whether an image will be
"different" beforehand.
There is another question coming up here: I have a JPEG imag with a
size of 800x600 pixels. iPhoto, Preview, PhotoShop and virtually
every other app that I can find on my computer says so. NSImage does
not. Okay, (I thought otherwise but) I obviously am a newbie to
NSImage and friends.
I have a custom view that simply takes the image (created via NSImage
initWithContentsOfFile:) and displays it. Querying its size via -size
reports (192, 144) and the result onscreen looks like that too. Is it
possible that there is some kind of thumbnail stored in the image and
that NSImage takes that?
How can I reach through to the actual image?
- Michael
_______________________________________________
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