• 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 Text in an NSImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing Text in an NSImage


  • Subject: Re: Drawing Text in an NSImage
  • From: "Henry McGilton (Boulevardier)" <email@hidden>
  • Date: Thu, 27 Aug 2009 21:37:53 -0700


On Aug 27, 2009, at 8:13 PM, Seth Willits wrote:


drawAtPoint/drawInRect in NSString/NSAttributedString says...

"You should only invoke this method when an NSView object has focus."
"Don’t invoke this method while no NSView is focused."


When an image is focused, and you draw text, it'll definitely do wonky things if the currently focused view is flipped. If we can't use these methods, are we really supposed to drop down to NSLayoutManager etc etc to draw a simple string? Is there really no secret API for image-friendly string drawing? Just want to double check before I have to go invent one...

Not quite sure what is the problem you're having here, Seth.

Create your NSImage.    lockFocus on the image.    Draw into the image.
i have two apps that draw into images using drawAtPoint, and I don't see
any problems relating to views . . .

    Cheers,
        . . . . . . . .  Henry



_______________________________________________

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: Drawing Text in an NSImage
      • From: Seth Willits <email@hidden>
References: 
 >Drawing Text in an NSImage (From: Seth Willits <email@hidden>)

  • Prev by Date: Re: creating registration codes
  • Next by Date: Re: Making failed NSAsserts crash an app
  • Previous by thread: Drawing Text in an NSImage
  • Next by thread: Re: Drawing Text in an NSImage
  • Index(es):
    • Date
    • Thread