![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Everything works, except that icons look ugly. It seems that color depth is decreased and alpha blending is not applied at all. Here's screenshot fragment to illustrate the problem: |
#3
| |||
| |||
|
|
Everything works, except that icons look ugly. You will get better results associating the ListView directly with the system image list. |
|
Since you use the API I guess you can prototype the API calls and structures, if not come back here. |
#4
| |||
| |||
|
|
To accomplish anything decent I required to hack my way through the intricacies of Interop and environment doesn't help me there. I hoped that WinForms will save me some hair on the head, while making me able to cncentrate on "interesting" parts. On the contrary. |
#5
| |||
| |||
|
|
Absolutely, it's very disappointing to have to use what are essentially VB6 techniques to access the API. Why MSFT didn't include an API Namespace I do not know. |
|
I keep dabbling with Delphi, at least it provides 'grown up' functions. |
#6
| |||
| |||
|
|
I never used Delphi myself. Correct me if I wrong, but I thought that Delphi is inherently incapable of doing Unicode builds. Is it true? |
#7
| |||
| |||
|
|
Hello, I'm writing Visual Studio add-in in C# (VS 2008, WinXP SP2). I need to display a list of files in ListView control. In order to get the file type's associated icon I use `SHGetFileInfo' API from Shell32.dll (the code is taken verbatim from here:http://www.codeproject.com/csharp/iconhandler.asp). Then I add resulting icons to ImageList control, which is assigned to `SmallImageList' property of ListView control: Icon icon = IconFromExtension(extension, SHGFI_SMALLICON); _imageList.Images.Add(extension, icon); Everything works, except that icons look ugly. It seems that color depth is decreased and alpha blending is not applied at all. Here's screenshot fragment to illustrate the problem: [16KB, PNG]http://farm3.static.flickr.com/2176/2077118696_43d3176baf_o.png How can I fix it? Thanks in advance Alex |
#8
| |||
| |||
|
|
I had the same problem and while debugging i found that the color depth was set to 8bit by default. So this fixed that.... imageList.ColorDepth = ColorDepth.Depth32Bit; Then the alpha color is usually handled through the TransparentColor property. imageListLarge.TransparentColor = Color.White; |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |