[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

Re: Converting 2 colors picture from TIFF to GIF

Bob Powell

9/21/2004 7:11:00 PM

The overhead of the GIF palette is negligable so why worry?.

For academic argument I think it would be possible to write a two entry
palette using methods similar to those detailed in the GDI+ FAQ article on
creating transparent GIF files.

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

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

The GDI+ FAQ RSS feed: http://www.bobpowell.net/f...
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tips...
Bob's Blog: http://bobpowelldotnet.blogspot.co...






"josemarciano" <josemarciano@discussions.microsoft.com> wrote in message
news:269D2A7E-4206-4D49-B9CB-A3410F0A67BE@microsoft.com...
> Hi.
>
> In an ASP.NET page, I am converting from a TIFF picture, that has a
palette
> of 2 colors (1 bit), to a GIF, using the the code below, and it works
fine.
>
> The problem is that the GIF always gets a palette of 256 colors (8 bits).
Is
> there a way to force the GIF to have only 2 colors?
>
> Thanks in advance.
>
>
> '============= BEGIN MY CODE ===============
> Dim img As System.Drawing.Bitmap
>
> img = System.Drawing.Bitmap.FromFile(Server.MapPath("/") & "pic1.tiff")
>
> img.Save(Server.MapPath("/") & "pic2.gif",
> System.Drawing.Imaging.ImageFormat.Gif)
>
> img.Dispose()
> img = Nothing
> '============= END MY CODE ===============
>