Groups | Blog | Home
all groups > dotnet drawing api > september 2005 >

dotnet drawing api : Create and save a transparent GIF - Please help


expertware NO[at]SPAM libero.it
9/28/2005 10:56:52 AM

Hi guys! I am back with an easy question.
Pamela

I have this task to do. Seems crazy but Later I will explain
the reason. Can anybody provide me with a simple answer.

I need to create and save to disk a .GIG image, say "blank.gif"
the image is a bitmap transparent of any size (even 1x1 will do).
Must be transparent.

Can anyone provide a snippet on how to do that. While I had no
problems with PNG, I am not very confident that palette staff...

Thank you!

-Pamela
Bob Powell [MVP]
9/28/2005 8:49:02 PM
See the GDI+ FAQ

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





[quoted text, click to view]

expertware NO[at]SPAM libero.it
9/29/2005 3:20:42 AM
I have read that nice document.
It is too complete for my simple task. I would need something much
simpler like:

Dim BlankGif As New Bitmap(1, 1,
System.Drawing.Imaging.PixelFormat.Format8bppIndexed)
BlankGif.Palette.Entries(0) = Color.FromArgb(0,
BlankGif.Palette.Entries(0))
BlankGif.SetPixel(0, 0, BlankGif.Palette.Entries(0))
BlankGif.Save(DirectoryTarget & "\" & "Blank.gif",
ImageFormat.Gif)

but set pixel here is not accepted (nor the clear() command). Can
anyone suggest the appropriate correction?

Thank you

-Pamela
Bob Powell [MVP]
9/29/2005 1:58:32 PM
If there was a simpler way of doing it I'd have written about that instead.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





[quoted text, click to view]

AddThis Social Bookmark Button