Home All Groups Group Topic Archive Search About

Passing a ColorPalette as an argument

Author
23 Nov 2007 3:10 AM
Nathan Sokalski
I have finally figured out how to create transparency in GIF files when
creating them with VB.NET (it is harder than I think it should be, but at
least I can do it now). I would like to write a couple functions and/or
subroutines to make this easier. However, when I pass a Bitmap as a
parameter it does not include the data from the Palette property. I have
also tried passing the Palette as a separate argument, but the same problem
occurred. I cannot write a function or subroutine for creating transparency
without being able to pass the Palette. Why is the Palette not being passed,
and what can I do about it? Thanks.
--
Nathan Sokalski
njsokal***@hotmail.com
http://www.nathansokalski.com/

Author
23 Nov 2007 5:17 PM
Michael Phillips, Jr.
> Why is the Palette not being passed

Are you sure that the PixelFormat property of the Bitmap passed as an
argument is one of the Indexed pixel formats?

Check it before you pass it as an argument and after to be sure.


Show quoteHide quote
"Nathan Sokalski" <njsokal***@hotmail.com> wrote in message
news:OK3Zs5XLIHA.3516@TK2MSFTNGP02.phx.gbl...
>I have finally figured out how to create transparency in GIF files when
>creating them with VB.NET (it is harder than I think it should be, but at
>least I can do it now). I would like to write a couple functions and/or
>subroutines to make this easier. However, when I pass a Bitmap as a
>parameter it does not include the data from the Palette property. I have
>also tried passing the Palette as a separate argument, but the same problem
>occurred. I cannot write a function or subroutine for creating transparency
>without being able to pass the Palette. Why is the Palette not being
>passed, and what can I do about it? Thanks.
> --
> Nathan Sokalski
> njsokal***@hotmail.com
> http://www.nathansokalski.com/
>