473,382 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

ImageList issue

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
5 1429
"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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ian | last post by:
Hi, I've been trying to create a listview and treeview with icons. You would think it's a pretty straight forward task. API documentation states you simply assign an ImageList - that's been...
2
by: Bob C. | last post by:
Hi All, I am using the ImageList/ListView Components to display around 100 images in C#.NET. The issue i have is, some times i may need to display the thumbnail of size more then 256x256 in...
2
by: Sanjeeva Reddy | last post by:
hai Anti Keskinen, i have used the following code MyListView->LargeImageList->ImageSize = gcnew System::Drawing::Size(100, 100); // Sets large image size to 100, 100 here i am getting error...
11
by: Juan Romero | last post by:
Hey guys, I have an ImageList control that stores my icons. What I need to do is find out if the icon at hand already exists in the ImageList so I dont enter it twice. How can I do that? ...
16
by: Roger | last post by:
....or am I missing something? Setup: - I've created an empty Winforms project, and added two buttons A and B. - Button A's Image property is set to point to a imagefile calles "users.png" -...
4
by: David | last post by:
I have a problem that just cropped up with using an ImageList in my project I am using VB .NET 200 Problem: I have existing Form with 2 Image List controls. ImageList16 (for 16x16 Images) and...
4
by: MrPickwick | last post by:
Hi there. If I place a picturebox on my form and load (at design time) an animated gif into it, it shows and animates allright. If I load my animated gifs in an Imagelist at design time and at...
2
by: Michael Maes | last post by:
Hi, We have been using ImageLists in our Projects extensively. Many forms have two ILs with nearly 900 bmp's each. They are configured: 32Bit, Fuchsia, 16x16 (and one 24x24). In VS2003 there...
6
by: [Joe] | last post by:
Hi, How can I get the System class ImageList from C# application, I want to receive this image list used in device manager ? I find a C API : WINSETUPAPI BOOL WINAPI SetupDiGetClassImageList(...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.