Re: drawing flipped images
Re: drawing flipped images
- Subject: Re: drawing flipped images
- From: Chuck Soper <email@hidden>
- Date: Mon, 5 Jul 2004 09:44:38 -0700
At 4:01 PM +0200 7/5/04, Allan Odgaard wrote:
On 5. Jul 2004, at 8:21, Chuck Soper wrote:
What is the best solution for this issue? Do I need two copies of
each image in memory, one flipped and one not flipped? Or, is there
an easier better way?
Changing the state of "isFlipped" does not change the actual image
data, so you can toggle it all you want. Or you can toggle it
before drawing to the NSImageCell context, or you can apply an
affine transform to flip the image...
But you certainly do not need two copies! :)
I don't know how I got the idea that setFlipped changes the actual
image data, but it certainly wasn't related to reading the
documentation. ;-)
In the NSImageCell context, I'm now toggling the flipped attribute of
the image before and after drawing. It works great:
[myImage setFlipped:YES];
... use drawInRect: to draw the image ...
[myImage setFlipped:NO];
Thanks also to Jerry LeVan and Jam Chen for their responses.
Chuck
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.