• 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: Fill box with repeating text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fill box with repeating text


  • Subject: Re: Fill box with repeating text
  • From: Dave Keck <email@hidden>
  • Date: Fri, 24 Apr 2009 18:10:05 -1000

> Makes the text transparent, but I can't seem to make the background of the
> NSImage transparent. I want to end up with white text on a transparent
> background, but [[NSImage alloc] initWithSize:[theString size]] seems to set
> the background to solid white.

This is because you're drawing the image incorrectly for your purposes. If you:

[[theImage TIFFRepresentation] writeToFile: [@"~/Desktop/halla.tiff"
stringByExpandingTildeInPath] atomically: YES];

That'll write the image to your desktop. Open it in Preview or
something, and you'll see that the background is, in fact,
transparent. What you want to do instead is use a different
compositing operation when you draw the image. NSCompositeSourceOver
is most likely what you want:

[theImage drawAtPoint: NSZeroPoint fromRect: NSZeroRect operation:
NSCompositeSourceOver fraction: 1.0];

David
_______________________________________________

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: Fill box with repeating text
      • From: Trygve Inda <email@hidden>
References: 
 >Re: Fill box with repeating text (From: Dave Keck <email@hidden>)
 >Re: Fill box with repeating text (From: Trygve Inda <email@hidden>)

  • Prev by Date: Re: Fill box with repeating text
  • Next by Date: Re: Fill box with repeating text
  • Previous by thread: Re: Fill box with repeating text
  • Next by thread: Re: Fill box with repeating text
  • Index(es):
    • Date
    • Thread