• 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: drawing flipped images
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >drawing flipped images (From: Chuck Soper <email@hidden>)
 >Re: drawing flipped images (From: Allan Odgaard <email@hidden>)

  • Prev by Date: I am having a problem with writeToFile:atomically:
  • Next by Date: Re: nsurlprotocol subclass
  • Previous by thread: Re: drawing flipped images
  • Next by thread: Re: drawing flipped images
  • Index(es):
    • Date
    • Thread