473,397 Members | 2,028 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,397 software developers and data experts.

converting bitmaps to icons at runtime

In VB6 I was able to convert a bitmap that was in a Imagelist to an
icon via the ExtractIcon method and display the result as a form's
Icon. I need to be able to do the same in .NET. Any ideas on how
this can be done?

thanks in advance...

Scott Mead
Nov 22 '05 #1
3 1323
Hi Scott,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to convert a bitmap image in
an ImageList to an icon at runtime. If there is any misunderstanding,
please feel free to let me know.

Based on my research, we can get the handle of a bitmap and then load the
Icon object from a handle. Here is an example:

ImageList i = new ImageList();
i.Images.Add(new System.Drawing.Bitmap(@"d:\Factory.jpg"));
System.Drawing.Icon ico =
System.Drawing.Icon.FromHandle(((Bitmap)i.Images[0]).GetHicon());
this.Icon = ico;

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 22 '05 #2
Hi Scott,

I'd like to know if this issue has been resolved yet. Is there anything
that I can help. I'm still monitoring on it. If you have any questions,
please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 22 '05 #3
Hi Scott,

I'd like to know if this issue has been resolved yet. Is there anything
that I can help. I'm still monitoring on it. If you have any questions,
please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 22 '05 #4

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

Similar topics

0
by: Brad Smalling | last post by:
Does anyone know if there is a reason to prefer bitmaps over icons (or vice-versa) when populating image lists? I've always favored icons because of their built-in transparency (although I've...
2
by: Scott Mead | last post by:
In VB6 I was able to convert a bitmap that was in a Imagelist to an icon via the ExtractIcon method and display the result as a form's Icon. I need to be able to do the same in .NET. Any ideas on...
0
by: Brad Smalling | last post by:
Does anyone know if there is a reason to prefer bitmaps over icons (or vice-versa) when populating image lists? I've always favored icons because of their built-in transparency (although I've...
0
by: Brad Smalling | last post by:
Does anyone know if there is a reason to prefer bitmaps over icons (or vice-versa) when populating image lists? I've always favored icons because of their built-in transparency (although I've...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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...
0
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,...
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...
0
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...
0
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...

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.