473,563 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ImageList: Is this a bug...?

....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"
- Added an imagelist and added the SAME image to this list, setting the
properties (size etc.) exactly the same as for A's Image property.
- Set button B's ImageList property to the new imagelist created, and it's
imageindex to 0.

The picture now shows on both buttons, but while Button A's image looks
great, Button B's image looks awful, with a blue border around
it....remember: It is the exact same picture, size, etc....

I did another post earlier, but after trying to tweak every possible setting
myself, and after extensive help from Armin Zingler, we have still not found
a reason for this behaviour. This may possibly be a problem affecting a lot
of users, so if anyone has suggestions on why this occurs, please let me
know... And if this is not a bug, there should be someone out there that
knows how to fix this....I hope... :-)

I've provided a link to my testproject, the original .png image is in the
/bin folder.

http://langedal.com/testicons.zip

Getting increasingly frustrated.... ;-)

Roger

Nov 20 '05 #1
16 2264
I tried setting the Imagelist's Colordepth to 24-bits instead of 8bit, and
nothing. So maybe it's a bug... The same happens on the Toolbar.
By the way, that is a great image! How/where did you get them? created them
yourself?

Andre Nogueira

"Roger" <ro******@hotma il.com> wrote in message
news:uF******** ******@TK2MSFTN GP10.phx.gbl...
...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"
- Added an imagelist and added the SAME image to this list, setting the
properties (size etc.) exactly the same as for A's Image property.
- Set button B's ImageList property to the new imagelist created, and it's
imageindex to 0.

The picture now shows on both buttons, but while Button A's image looks
great, Button B's image looks awful, with a blue border around
it....remember: It is the exact same picture, size, etc....

I did another post earlier, but after trying to tweak every possible
setting
myself, and after extensive help from Armin Zingler, we have still not
found
a reason for this behaviour. This may possibly be a problem affecting a
lot
of users, so if anyone has suggestions on why this occurs, please let me
know... And if this is not a bug, there should be someone out there that
knows how to fix this....I hope... :-)

I've provided a link to my testproject, the original .png image is in the
/bin folder.

http://langedal.com/testicons.zip

Getting increasingly frustrated.... ;-)

Roger

Nov 20 '05 #2
* "Roger" <ro******@hotma il.com> scripsit:
...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"
- Added an imagelist and added the SAME image to this list, setting the
properties (size etc.) exactly the same as for A's Image property.
- Set button B's ImageList property to the new imagelist created, and it's
imageindex to 0.

The picture now shows on both buttons, but while Button A's image looks
great, Button B's image looks awful, with a blue border around
it....remember: It is the exact same picture, size, etc....


That's an issue with the ImageList control. The imagelist will support
bitmaps only when used at design time. Nevertheless, I didn't get it
work with adding the images at runtime (the blue changes to black).

There were some other threads on this issue, maybe you will find
something useful there:

<http://www.google.com/groups?q=dotnet +imagelist+tran sparency+png>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> schrieb

There were some other threads on this issue, maybe you will find
something useful there:

<http://www.google.com/groups?q=dotnet +imagelist+tran sparency+png>


If I had been so clever to ask google first, it would have saved me about 5
hours.... ;-((
--
Armin

Nov 20 '05 #4
* "Armin Zingler" <az*******@free net.de> scripsit:
There were some other threads on this issue, maybe you will find
something useful there:

<http://www.google.com/groups?q=dotnet +imagelist+tran sparency+png>


If I had been so clever to ask google first, it would have saved me about 5
hours.... ;-((


Google is your friend!

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
Thanks guys for excellent help :-)

As a workaround I've ended up doctoring the png's into bmp's with a
background color matching my app, to fake transparency... . :-D Annoying
extra-work, but it works..... Hope MS knows about this issue and addresses
it...

Thanks again,
Roger
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bv******** ****@ID-208219.news.uni-berlin.de...
* "Roger" <ro******@hotma il.com> scripsit:
...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"
- Added an imagelist and added the SAME image to this list, setting the
properties (size etc.) exactly the same as for A's Image property.
- Set button B's ImageList property to the new imagelist created, and it's imageindex to 0.

The picture now shows on both buttons, but while Button A's image looks
great, Button B's image looks awful, with a blue border around
it....remember: It is the exact same picture, size, etc....


That's an issue with the ImageList control. The imagelist will support
bitmaps only when used at design time. Nevertheless, I didn't get it
work with adding the images at runtime (the blue changes to black).

There were some other threads on this issue, maybe you will find
something useful there:

<http://www.google.com/groups?q=dotnet +imagelist+tran sparency+png>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #6
* "Roger" <ro******@hotma il.com> scripsit:
As a workaround I've ended up doctoring the png's into bmp's with a
background color matching my app, to fake transparency... . :-D Annoying
extra-work, but it works..... Hope MS knows about this issue and addresses
it...


But this won't allow an alpha chanel, or am I missing something?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #7
True :-)

It seemed at first glance to work, but no it is far from what I
wanted....but I haven't found a way to "hack" this from the links you
posted. Maybe I'm giving up way to easily.... :-)
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:bv******** ****@ID-208219.news.uni-berlin.de...
* "Roger" <ro******@hotma il.com> scripsit:
As a workaround I've ended up doctoring the png's into bmp's with a
background color matching my app, to fake transparency... . :-D Annoying
extra-work, but it works..... Hope MS knows about this issue and addresses it...


But this won't allow an alpha chanel, or am I missing something?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #8
* "Roger" <ro******@hotma il.com> scripsit:
It seemed at first glance to work, but no it is far from what I
wanted....but I haven't found a way to "hack" this from the links you
posted. Maybe I'm giving up way to easily.... :-)


I had a look at the links I posted and I see that there is no good
solution to the problem available.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #9
If I convert my .png to an .ico file, and add it to my project as an
embedded resource it seems to handle the transparency problem moe
gracefully, but still the edges seems jagged and rough...

Using this code:

ImageList1.Imag es.Add(New
Icon(System.Ref lection.Assembl y.GetExecutingA ssembly.GetMani festResourceStr e
am("testIcons.u sers128.ico")). )
ImageList1.Imag eSize = New System.Drawing. Size(128, 128)

Button1.ImageLi st = ImageList1
Button1.ImageIn dex = 0
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:Or******** *****@tk2msftng p13.phx.gbl...
* "Roger" <ro******@hotma il.com> scripsit:
It seemed at first glance to work, but no it is far from what I
wanted....but I haven't found a way to "hack" this from the links you
posted. Maybe I'm giving up way to easily.... :-)


I had a look at the links I posted and I see that there is no good
solution to the problem available.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1004
by: SpaceMind | last post by:
Hi, I´m using this code for changing the size property of an ImageList : ImageList.ImageSize = new Size(32,32); However , the Icon property just lost´s his data. Before code: ImageList.Images.Count == 1 After:
2
2300
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 ImageList. But the ImageList Component supports only size upto 256x256. What is the best way to handle this?
2
8513
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 like "gcnew is undeclared error",how to deeclare 'gcnew" and when i am using in runtime to change the size of images in imagelist in listview control...
7
2092
by: Andrew Christiansen | last post by:
Hey everyone. I have Visual Basic .NET 2003 and am trying to show images on a treeview control. I have the imagelist on the form filled with images, and have the ImageList property of the treeview control set to the imagelist containing the images I want to be displayed next to each node. It seems that no matter what I do there will be no...
4
4317
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 ImageList24 (for 24x24). I have inserted images in each and it has worked fine for months... The System.Drawing.Bitmap properties for these images are...
4
2188
by: Just Me | last post by:
If I add an image to an imagelist using imageList.Images.Add... And use it with a tree node tn.ImageIndex = imageList.Images.Count-1 This is the actual code: Win32.Shell.SHGetFileInfo(NodePath, 256, fileinfo, cbFileInfo, flags) tvFolders.ImageList.Images.Add(Icon.FromHandle(fileinfo.hIcon)) tn.ImageIndex = tvFolders.ImageList.Images.Count...
6
3020
by: henrycortezwu | last post by:
Hi, I have a WinXPSP2, P4 3.2GHZ, 1GIG RAM on my dev machine using VS2005 VB.NET. I did the following procedure: 1. Added 82 icons (128x128 in size & 32bit Depth) in an imagelist control 2. Save the project 3. Complied the project (successful) 4. Closed the project 5. Opened the project
2
4844
by: senfo | last post by:
I'm using a ListView control to display pictures similarly to how Windows Explorer displays pictures in "Thumbnails" view. The images are stored in an ImageList component. I would like to provide the ability to rotate the images and I'm having some issues. Basically, what I've tried is: ...
0
1216
by: wolffy | last post by:
okay heres my problem; i want to add image K to a imagelist, thats easy. The hard part is that the imagelist was made in Application Settings. **I made the imagelist in application settings so i could eventually add in code which would make its value saved when the form closes** But every time i use something like this image k =...
2
3548
by: =?Utf-8?B?S2VuTg==?= | last post by:
We're using a System.Windows.Forms.ImageList to store a bunch of Images that I've loaded, and rendering each image in the ImageList during a draw loop. The process was running unusually slow and was causing memory spikes. After several hours we discovered that the ImageList.Images indexer is actually returning a copy of the added Images...
0
7658
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7630
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7941
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6235
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5201
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3612
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2077
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.