Hi Juan,
Does this answer your question:
' Retreive Bitmap from imageList
Dim bmp As Bitmap = DirectCast(Me.imgICO16.Images(1), Bitmap)
' Convert bitmap to Icon
Dim ico As Icon = Icon.FromHandle(bmp.GetHicon)
' Perform your logic
HTH,
Michael
| Yes.....
| The problem is that I am inserting ICONS. Icons get converted into
bitmaps,
| so once the icon is in there, there is no way I can check it.
|
| For instance, suppose I add "iconA" to the imagelist. I don't want to have
| the same icon more than once on that imagelist, so the next time I add an
| icon, I want to be able to check if the icon exists already in the list.
The
| problem is that when the icon is inserted into the list, it is converted
and
| stored as a bitmap, so when I check, I end up comparing AN ICON AGAINST A
| BITMAP. So the issue is how do I make this work out. The only possible way
I
| see is to convert one of them to the opposite format, WHICH IS NOT
POSSIBLE,
| or at least I dont know how.
|
| If anyone knows how, or an alternative way of dealing with this, please
let
| me know.
|
| Thanks!
|
|
| | > > Correct, which is exactly my problem, how do I compare the bitmap to
| > > the icon?
| > > Don't forget that what I want to do is to find out if a particular
| > > icon has been entered into the imagelist (even if it was converted to
| > > a bitmap). There is no conversion from bitmap to icon or viceversa,
| > > or maybe there is and I dont know about it?
| >
| > I guess I didn't understand the question. To find out if the image has
| been
| > inserted in the imagelist, you must have a look at the content of the
| > imagelist.
| >
| > Maybe Herfried knows the answer.
| >
| >
| > --
| > Armin
| >
| >
http://www.plig.net/nnq/nquote.html
| >
http://www.netmeister.org/news/learn2quote.html
| >
|
|