Re: Rasterizing an NSString to a bitmap
Re: Rasterizing an NSString to a bitmap
- Subject: Re: Rasterizing an NSString to a bitmap
- From: Dietmar Planitzer <email@hidden>
- Date: Wed, 9 Jun 2004 23:49:43 +0200
On Jun 9, 2004, at 11:25 PM, John Stiles wrote:
Given an NSImage, I am not sure if there is any guarantee that it will
have an NSCachedImageRep.
NSImage always creates an NSCachedImageRep when you call -lockFocus on
it. This is documented somewhere in the NSImage docs.
I agree that given an NSCachedImageRep, it's not hard to pull the
pixels out. But as you state yourself, it's an implementation detail
and one that Apple is not required to maintain in future OS updates.
Well, Apple must maintain this implementation detail because otherwise
every graphics related Carbon app would instantly stop working. They
expect that they can access the pixels of a window / framebuffer by
accessing the PixMap of a GrafPort and locking that. In fact, Apple
even mentions this technique in its "porting Windows apps to MacOS X"
documentation.
Regards,
Dietmar Planitzer
_______________________________________________
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.