• 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: How to draw text to bitmap (array) with pre 10.5 libs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How to draw text to bitmap (array) with pre 10.5 libs
      • From: John Horigan <email@hidden>
References: 
 >How to draw text to bitmap (array) with pre 10.5 libs (From: Glenn McCord <email@hidden>)

  • Prev by Date: Re: troubles with tableview
  • Next by Date: Re: How to draw text to bitmap (array) with pre 10.5 libs
  • Previous by thread: How to draw text to bitmap (array) with pre 10.5 libs
  • Next by thread: Re: How to draw text to bitmap (array) with pre 10.5 libs
  • Index(es):
    • Date
    • Thread