Re: How to draw text to bitmap (array) with pre 10.5 libs
Re: How to draw text to bitmap (array) with pre 10.5 libs
- Subject: Re: How to draw text to bitmap (array) with pre 10.5 libs
- From: Graham Cox <email@hidden>
- Date: Mon, 30 Nov 2009 16:09:03 +1100
On 30/11/2009, at 2:44 PM, Glenn McCord wrote:
> What I'm expecting is the drawAtPoint method to draw nsString inside
> the bitmapRep of the NSContext at which point I can retrieve the raw
> data and do something with it. On account of the data all being zero,
> I'm obviously doing something wrong and would really appreciate some
> advice.
You also have to lock focus on the bitmap, which requires that it first be added to an NSImage (I think if you are targeting 10.6 only there is a new API that means you can avoid this).
Also, it's not necessary to allocate the bitmap's buffer - if you don't pass one, it will allocate it for you.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden