• 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: fast text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fast text


  • Subject: Re: fast text
  • From: "John C. Randolph" <email@hidden>
  • Date: Mon, 25 Nov 2002 15:37:30 -0800

On Monday, November 25, 2002, at 03:27 PM, Alexander White wrote:

Thanks for the help. I have one more question. In my program I do some animation with images. My experience there suggest that it is faster to draw a CGImageRef to a CGContextRef than to draw a NSImage to the current NSGraphicsContext. I know how to get a CGContextRef using [NSGraphicsContext currentContext], but I do not know how to get a CGImageRef form a NSImage. Do you know how to do this?

I haven't had occasion to do this, but you can get the raw image bytes from an NSBitmapImagRep with the -bitmapData method. You should be able to to create a CGImage from that, given that you can query the bits per sample, samples per pixel, etc from the BitmapImageRep.

-jcr


John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
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: 
 >Re: fast text (From: Alexander White <email@hidden>)

  • Prev by Date: Re: fast text
  • Next by Date: Delegate weirdness in pref pane
  • Previous by thread: Re: fast text
  • Next by thread: Drag and Drop Weirdness?
  • Index(es):
    • Date
    • Thread