adding PNG icons with tranparency to listview
-
Hello every one, I am using the following code to add items to my listview I have PNG icons 16x 16 with transparency , unfortunately the icons as a result of this code look really bad in the listvirew. looks like it is not getting the transparency of the the image, PLease help, thanks in advacne.. Ahmed ImageList imList = new ImageList(); Image img = new System.Drawing.Bitmap(@"D:\Resources\PNG\User.png"); imList.Images.Add(img); listViewUsers.SmallImageList = imList; foreach (MItem mItem in items) { this.listViewUsers.Items.Add("hello world", "hello world", 0); }
Ahmed
-
Hello every one, I am using the following code to add items to my listview I have PNG icons 16x 16 with transparency , unfortunately the icons as a result of this code look really bad in the listvirew. looks like it is not getting the transparency of the the image, PLease help, thanks in advacne.. Ahmed ImageList imList = new ImageList(); Image img = new System.Drawing.Bitmap(@"D:\Resources\PNG\User.png"); imList.Images.Add(img); listViewUsers.SmallImageList = imList; foreach (MItem mItem in items) { this.listViewUsers.Items.Add("hello world", "hello world", 0); }
Ahmed
It is not your
ListView
that is the problem but theImageList
. This is a well known problem and it is disgusting IMNSHO that M$ have not fixed this huge bug by .NET 3.5! :mad: My rant doesn't help you though, so take a look at this CP article Adding and using 32 bit alphablended images and icons to the imagelist control[^] to see if it helps you understand what is happening. If that is no help try Googling on C# imagelist transparency. You will get loads and loads of hits. Good luck! :)Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”