473,705 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ImageList problem

Hi,

I have a problem for use of imagelist.

The problem is I have written a code which returns me the icons
associated with the files depending on their type.

After getting the icon for the file I am adding the icon to the
imagelist and then use its position to display the icon in the
listview.

When I directly associate the icon to the item in the listview
then there is no problem, but if I add the icon to the imagelist
and associate this with the Listview then the icon displayed in the
listview is having a black border appearance.Whic h is not in the
previous.And it is necessary for me to add the icons in the
imagelist.

What could be the problem?
Is there any solution to the problem.

Thanks in advance

Nov 23 '05 #1
2 3960
When you say "black border appearance", do you mean that there is a problem
in the transparency? AFAIK, what you get from the files are bitmaps, not
icons and since bitmaps do not support transparency natively, so have to set
which is the transparent color. ImageLists have a property for that.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"sonu" <so************ *@yahoo.com> escribió en el mensaje
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
Hi,

I have a problem for use of imagelist.

The problem is I have written a code which returns me the icons
associated with the files depending on their type.

After getting the icon for the file I am adding the icon to the
imagelist and then use its position to display the icon in the
listview.

When I directly associate the icon to the item in the listview
then there is no problem, but if I add the icon to the imagelist
and associate this with the Listview then the icon displayed in the
listview is having a black border appearance.Whic h is not in the
previous.And it is necessary for me to add the icons in the
imagelist.

What could be the problem?
Is there any solution to the problem.

Thanks in advance

Nov 23 '05 #2
I load icons from embedded resource icon files all time and the transparency
is preserved when is use the imagelist index nos in things like TreeView, etc.
--
Dennis in Houston
"Carlos J. Quintero [VB MVP]" wrote:
When you say "black border appearance", do you mean that there is a problem
in the transparency? AFAIK, what you get from the files are bitmaps, not
icons and since bitmaps do not support transparency natively, so have to set
which is the transparent color. ImageLists have a property for that.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"sonu" <so************ *@yahoo.com> escribió en el mensaje
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
Hi,

I have a problem for use of imagelist.

The problem is I have written a code which returns me the icons
associated with the files depending on their type.

After getting the icon for the file I am adding the icon to the
imagelist and then use its position to display the icon in the
listview.

When I directly associate the icon to the item in the listview
then there is no problem, but if I add the icon to the imagelist
and associate this with the Listview then the icon displayed in the
listview is having a black border appearance.Whic h is not in the
previous.And it is necessary for me to add the icons in the
imagelist.

What could be the problem?
Is there any solution to the problem.

Thanks in advance


Nov 23 '05 #3

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

Similar topics

4
4874
by: Chuck | last post by:
When ever I try to implement an ImageList, I always get an exception when the application runs. The ImageList doesn't even have to be used by anything. An empty ImageList doesn't throw! The following exception is thrown by the following code. ***** 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll Additional information: Exception has been thrown by the target of an
2
3182
by: A. Solomon | last post by:
Hi, I have a ImageList containing 4 bitmaps attached to a UserControl which acts as a Open/Close panel. This panel, upon click, switches the image in a PictureBox control to indicate the current panel status (Open/Close). Problem is that in certain complex scenarios the images disappear! from the ImageList. That is, when I call: imageList.Images, I get
2
2305
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?
11
3911
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? Thanks in advance!
7
2098
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 images displayed next to the nodes during runtime. I tried creating nodes during designtime using...
4
4331
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 PixelFormat=32bppArgb and RawFormat=MemoryBmp with the Horiz and VerticalResolution = 96 I...
0
2863
by: Andre Viens | last post by:
Hello, I am using the following variation of code from <http://support.microsoft.com/default.aspx?scid=kb;EN-US;319340> to add icons to an imagelist for use in a listview: Private Structure SHFILEINFO Public hIcon As IntPtr ' : icon Public iIcon As Integer ' : icondex Public dwAttributes As Integer ' : SFGAO_ flags
6
3037
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
0
1232
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 = toolstrip1.backgroundimage; Settings.Default.kill.Images.Add(k); **kill is the name of the imagelist** i get...
0
8767
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8689
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9273
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9030
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8979
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6605
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5933
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4703
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3137
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

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.