• 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: Writing on an NSImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing on an NSImage


  • Subject: Re: Writing on an NSImage
  • From: David Remahl <email@hidden>
  • Date: Mon, 29 Apr 2002 15:13:02 +0200

> Hello,
>
> Any ideas as to how I would go about writing text onto an NSImage??
>
> I am loading a picture from the disk, and would like to add text to it but
> have no clue as to how I would do that... Though I know that it is possible
> to add an image to another, so at worst I could have a bitmap for each
> letter and manually add each in turn as I write, but this is a shoddy
> solution.
>
> Any help would be great,
>
> Matt Smith

NSImage *yourImg = [NSImage imageNamed:@"Whatever"];

[yourImg lockFocus];
[@"Your string" drawAtPoint:NSMakePoint(0,0)] // See NSStringDrawing.h for
alternatives or <AppKit/NSAttributedString.h> for attributed string drawing
[yourImg unlockFocus];

/ Rgds, David
_______________________________________________
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.

References: 
 >Writing on an NSImage (From: Matthew Smith <email@hidden>)

  • Prev by Date: Final reminder: WWDC "Reusable component showcase"
  • Next by Date: cocoa.mamasam.com back to normal
  • Previous by thread: Writing on an NSImage
  • Next by thread: Final reminder: WWDC "Reusable component showcase"
  • Index(es):
    • Date
    • Thread