• 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: Gif to TIFF and transparency
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gif to TIFF and transparency


  • Subject: Re: Gif to TIFF and transparency
  • From: Charles Jolley <email@hidden>
  • Date: Mon, 1 Jul 2002 09:10:48 -0500

Try:

[image lockFocus] ;
[[NSColor whiteColor] set] ;
[NSBezierPath fillRect: NSMakeRange(0,0,imageWidth,imageHeight)] ;
[image unlockFocus] ;

-C

On Sunday, June 30, 2002, at 08:42 PM, Renaud Boisjoly wrote:

Hi Brian

Thanks for the idea... but I think it didn't work.

What happens is that when I try to put the TIFF representation of this gif onto the Pasteboard, it still gets a black background...

What I tried which works but is slow, is to load a second image from a white jpeg file and composite that just before the gif... prtobably not pretty, but I wanted to see if it would work. It does... and it probably shows how much of a novice I am at all this ;-)

So now I'm trying to create a bezier path (rect) to fill an NSImage to render that instead of my large white image because that is too slow... but I cannot figure it out.

Ca someone point me to the steps required to simply draw a white rectangle the size of an NSImage I create with initWithSize? It seems a little convoluted to me...

thanks for your help!

Renaud

On Saturday, June 29, 2002, at 05:37 PM, Brian Webster wrote:


Is there a way to take this gif image and transform it so that we can
replace the selected transparent pixel to white as it appears when
inserted in a regular View?

I'm not certain this will work, as it depends on whether NSImage recognizes the transparent pixel when reading in a GIF, but you could try it and see. Create a new NSImage (using -initWithSize), lock focus on it, fill it with [NSColor clearColor], and then composite the GIF onto it using NSCompositeSourceOver for the operation. If NSImage respects the transparent pixel when drawing, this should result in an image with the correct translucency that you can then save to a file.
_______________________________________________
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.
_______________________________________________
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: set***Value: Method not working
  • Next by Date: Re: Centering an Image in an NSScrollView
  • Previous by thread: Re: set***Value: Method not working
  • Next by thread: Re: Gif to TIFF and transparency
  • Index(es):
    • Date
    • Thread