By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,581 Members | 1,811 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,581 IT Pros & Developers. It's quick & easy.

ImageList issue

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"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/>

Nov 21 '05 #2

P: n/a
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

Nov 21 '05 #3

P: n/a
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()

"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

Nov 21 '05 #4

P: n/a
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
Nov 21 '05 #5

P: n/a
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.

"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

Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.