473,387 Members | 1,504 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,387 software developers and data experts.

ListView Icon color depth

hi,
I have a problem displaying icons at the right colour depthin a
ListView.

I've made an icon file, (using IconWorkshop 5), it has 3 icons within
it. A 32x32 32bpp XP style icon, a 32x32 32bpp non-xp icon (no
transparency), and a 16x16 version.

I add these icons to an ImageList, which is then assigned to the
LargeImageList property of the ListView.

The list view dislays the XP-style icon even on Win2k. I would like to
be able to tell it to display the non-xp version of the icon.

I've tried setting the "ColorDepth" property of the ListView- but it
seems to make no difference.

In Windows File Explorer they display correctly (ie, on win2k it shows
the non-xp icon).

It also seems to slightly distort the image - (it seems to take the XP
icon, and convert its colour depth)- , compared to the Windows
Explorer version.

Any ideas? I'm getting desparate.

Thanks,
David.
Nov 16 '05 #1
3 6552
Hi scoobydoo,

As i remeber, if you want to change color depth of images in
ImageList, then you should set ImageList's ColorDepth before
you add these images.

AFAIK ListView does not have any property like "ColorDepth".

Marcin
hi,
I have a problem displaying icons at the right colour depthin a
ListView.

I've made an icon file, (using IconWorkshop 5), it has 3 icons within
it. A 32x32 32bpp XP style icon, a 32x32 32bpp non-xp icon (no
transparency), and a 16x16 version.

I add these icons to an ImageList, which is then assigned to the
LargeImageList property of the ListView.

The list view dislays the XP-style icon even on Win2k. I would like to
be able to tell it to display the non-xp version of the icon.

I've tried setting the "ColorDepth" property of the ListView- but it
seems to make no difference.

In Windows File Explorer they display correctly (ie, on win2k it shows
the non-xp icon).

It also seems to slightly distort the image - (it seems to take the XP
icon, and convert its colour depth)- , compared to the Windows
Explorer version.

Any ideas? I'm getting desparate.

Thanks,
David.

Nov 16 '05 #2
Hi David,

Only simple solution i see is:

1. Create a second ImageList with wanted ColorDepth
2. Copy all images from first into a second one.

I didn't test it, so if there will be any proplems
then let me know. Personaly i don't know how it will
work with TransparentColor?

Cheers!

Marcin
Hi,
Thank you for your reply.

I meant the ColorDepth property of the ImageList, not the List View, sorry.

The icons are embeeded resources, and are loaded :
Icon myIcon = new Icon(GetType(), "myico.ico");

I set the ImageSize, ColorDepth and Transparency properties of the Imagelist
before adding the icon to it.

Any clues,
TIA,
David

Nov 16 '05 #3
Hi,
Thank you for your reply.

I meant the ColorDepth property of the ImageList, not the List View, sorry.

The icons are embeeded resources, and are loaded :
Icon myIcon = new Icon(GetType(), "myico.ico");

I set the ImageSize, ColorDepth and Transparency properties of the Imagelist
before adding the icon to it.

Any clues,
TIA,
David
Nov 16 '05 #4

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

Similar topics

2
by: Matthias Kwiedor | last post by:
I have a Listview in Detail Mode. No i create lines with ListViewItem lvwItem = new ListViewItem(); lvwItem = new System.Windows.Forms.ListViewItem(new...
3
by: Marc W. | last post by:
Hello, I am trying to create a ListView object on my form with two columns. A small, 32 pixel wide column on the left for holding images, and a column that takes up the rest of the ListView on...
2
by: Anushya devi | last post by:
Hi All I used listview and tried to update it by using Addrange. When the number of items is less, it works fine.. But I need to update nearly 200,000 items and it hangs. Also i need to add...
0
by: scoobydoo | last post by:
Can anybody tell me how to define which icon is displayed in a listView? I'm writing in c#. My implementation ALWAYS uses the windows XP version of the icon within the ..ico file. I would like...
1
by: Víctor | last post by:
I'm doing a kind of file explorer with some additional funcionalities. The problem is that I'm not able to draw file extension icons in a ListView. I know how obtain icons, but when I try to draw...
3
by: OpticTygre | last post by:
Are there any good tutorials out on the net that explains the listview control with great detail? Things like drag-drop features, icon additions, etc...?
3
by: Maarten | last post by:
hi all, is there a way to show the icons of a file, used by the system in a listview. now i have something like: Private Sub AddFiles(ByVal nod As TreeNode) Dim strPath As String =...
2
by: Joe | last post by:
Anyone can suggest the best method of reading XML and adding data to ListView? Here is the xml data structure:: <xml> <site> <url>http://www.yahoo.com</url> <lastupdate></lastupdate>...
3
by: koredump | last post by:
Hi, I have an application that's being deployed using ClickOnce. Once deployed and installed on client machine, the form icon that I have added using the designer won't show up in any of the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.