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

Re: Compositing text over images


  • Subject: Re: Compositing text over images
  • From: Esteban Uribe <email@hidden>
  • Date: Mon, 24 Mar 2003 13:12:54 -0800

Hi John,

On Monday, March 24, 2003, at 12:05PM, John Timmer <email@hidden> wrote:

>I'd like to composite a bit of text on top of an NSImage, keeping the result
>as an NSImage. From poring over the docs, it seems like the way to do this
>would be to composite both to an NSView, then recover the image using
>NSView's dataWithPDFInsideRect: method to derive the resulting image. Is
>this accurate, or have I missed something?

The best way to do this is to draw offscreen, create an NSImage and lockfocus on it

Draw your NSImage first so that its in the background.

Then call NSString's  drawAtPoint:withAttributes: or  drawInRect:withAttributes:
(Both are AppKit additions to NSString)

Then unlock focus on the NSImage

Then use the resulting NSImage as you wish...

-Esteban
_______________________________________________
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.

  • Prev by Date: Re: Including headers from a framework?
  • Next by Date: Re: socket sample in cocoa
  • Previous by thread: Mounting Remote Volumes (again)
  • Next by thread: Re: socket sample in cocoa
  • Index(es):
    • Date
    • Thread