Home All Groups Group Topic Archive Search About
Author
31 Mar 2005 12:05 PM
Vittorio Pavesi
Hello,
I'm experiencing error displaying PNG images with transparent background
using ImageList; the picture is displayed in a wrong way.
Picturebox doesn't seem to be affected by this problem.
I also found some discussion on google about problem with imagelist and
images with alpha colour but I don't know what alpha colour is...
Any help ?


Vittorio Pavesi
------------------------
http://www.vittorio.tk

Author
31 Mar 2005 2:05 PM
Herfried K. Wagner [MVP]
"Vittorio Pavesi" <n@spam.it> schrieb:
> I'm experiencing error displaying PNG images with transparent background
> using ImageList; the picture is displayed in a wrong way.
> Picturebox doesn't seem to be affected by this problem.
> I also found some discussion on google about problem with imagelist and
> images with alpha colour but I don't know what alpha colour is...

An alpha channel adds additional transparency information to each pixel,
typically with values 0 to 255.  You can use Adobe Photoshop to create PNGs
with an alpha channel, for example.  Note that the imagelist component
currently cannot deal with an alpha channel.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
31 Mar 2005 3:10 PM
Vittorio Pavesi
Herfried K. Wagner [MVP] wrote:
> An alpha channel adds additional transparency information to each pixel,
> typically with values 0 to 255.  You can use Adobe Photoshop to create
> PNGs with an alpha channel, for example.  Note that the imagelist
> component currently cannot deal with an alpha channel.

Really thanks

Vittorio Pavesi
------------------------
http://www.vittorio.tk
Author
1 Apr 2005 1:09 AM
Dennis
Can you convert the PNG images to a bitmap then add the transparency color
and add it to the Image List:

dim v_Img24 as ImageList = new ImageList

  bm = (convert your PNG image to a bitmap)
  v_Img24.ImageSize = New Size(24, 24)
  v_Img24.TransparentColor = bm.GetPixel(0, 0)
  format = bm.PixelFormat
  v_Img24.Images.Add(bm)
   bm.Dispose()

Show quoteHide quote
"Vittorio Pavesi" wrote:

> Hello,
> I'm experiencing error displaying PNG images with transparent background
> using ImageList; the picture is displayed in a wrong way.
> Picturebox doesn't seem to be affected by this problem.
> I also found some discussion on google about problem with imagelist and
> images with alpha colour but I don't know what alpha colour is...
> Any help ?
>
>
> Vittorio Pavesi
> ------------------------
> http://www.vittorio.tk
>
Author
1 Apr 2005 9:48 AM
Vittorio Pavesi
Dennis wrote:
> Can you convert the PNG images to a bitmap then add the transparency color
> and add it to the Image List:
>
> dim v_Img24 as ImageList = new ImageList
>
>   bm = (convert your PNG image to a bitmap)
>   v_Img24.ImageSize = New Size(24, 24)
>   v_Img24.TransparentColor = bm.GetPixel(0, 0)
>   format = bm.PixelFormat
>   v_Img24.Images.Add(bm)
>    bm.Dispose()
Do the statement bm.GetPixel(0, 0) define white or transparent ?
Thanks

Vittorio Pavesi
------------------------
http://www.vittorio.tk
Author
2 Apr 2005 12:17 AM
Dennis
It is only the pixel in the upper left hand corner of the bitmap.  I know
that is the color I want to be transparent be it white, black, red, or
whatever.  If you don't know any pixel locations whose color is what you want
to be transparent, then this won't work.

Show quoteHide quote
"Vittorio Pavesi" wrote:

> Dennis wrote:
> > Can you convert the PNG images to a bitmap then add the transparency color
> > and add it to the Image List:
> >
> > dim v_Img24 as ImageList = new ImageList
> >
> >   bm = (convert your PNG image to a bitmap)
> >   v_Img24.ImageSize = New Size(24, 24)
> >   v_Img24.TransparentColor = bm.GetPixel(0, 0)
> >   format = bm.PixelFormat
> >   v_Img24.Images.Add(bm)
> >    bm.Dispose()
> Do the statement bm.GetPixel(0, 0) define white or transparent ?
> Thanks
>
> Vittorio Pavesi
> ------------------------
> http://www.vittorio.tk
>