473,486 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Converting from Icon to Image

I have am .ico file attached to the assembly as a Resource. I want to
convert this Icon to an Image object. I was unable to find anything on the
web about such convertion.

I can retrieve the icon using

Icon icon = new Icon(GetType(), "fileName.ICO");

Thanks!
Nov 16 '05 #1
2 28290
Ron,

What you want to do is call the ToBitmap method on the Icon instance,
and it will return an instance of a Bitmap. Since Bitmap derives from
Image, it should suit your needs quite nicely.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ron Burd" <rb***@hexacta.com> wrote in message
news:eM**************@TK2MSFTNGP11.phx.gbl...
I have am .ico file attached to the assembly as a Resource. I want to
convert this Icon to an Image object. I was unable to find anything on the
web about such convertion.

I can retrieve the icon using

Icon icon = new Icon(GetType(), "fileName.ICO");

Thanks!

Nov 16 '05 #2
I cannot believe I missed that...Thanks!
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:OR**************@TK2MSFTNGP10.phx.gbl...
Ron,

What you want to do is call the ToBitmap method on the Icon instance,
and it will return an instance of a Bitmap. Since Bitmap derives from
Image, it should suit your needs quite nicely.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ron Burd" <rb***@hexacta.com> wrote in message
news:eM**************@TK2MSFTNGP11.phx.gbl...
I have am .ico file attached to the assembly as a Resource. I want to
convert this Icon to an Image object. I was unable to find anything on the web about such convertion.

I can retrieve the icon using

Icon icon = new Icon(GetType(), "fileName.ICO");

Thanks!


Nov 16 '05 #3

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

Similar topics

9
1842
by: Richard | last post by:
Considering the elemtary image swap routine in javascript: document.name.src="filename.gif" How would this be translated into PHP? So that if a visitor has js turned off, clicking on a...
9
63175
by: arenaTR | last post by:
I'd like to put a logo in the titlebar of my webpage. The one I'm talking about is the one that's next to the URL in the address bar in both netscape and IE. Just so I'm clear, for example, on...
1
3715
by: Altemir | last post by:
I have a table that contains the following two columns: BITS (image(16)) BIT_LENGTH (int(4)) When I look at the table, I see "OLE Object" in the BITS column. What syntax should I use in...
0
1745
by: Mark Allen | last post by:
Hello, I am creating an RTF document server side for a report. However I am having problems converting images into the required RTF format. I am converting the image into a string (binary)...
1
2047
by: jack xu | last post by:
just like outlook when you insert a attachment ,a icon image of the file you selected will show in a textbox. Thanks.
0
1292
by: - HAL9000 | last post by:
Reference the visual basic power pack: http://msdn.microsoft.com/library/en-us/dv_vstechart/html/vbpowerpack.asp I have been using win32 SHGetFileInfoW to get icons for my "FileViewer" &...
1
2344
by: retheeshnewage | last post by:
I have a doubt in php.I wrote a php program to convert colour Images to balck & white.It is working fine with JPEG files and PNG files.When it comes to GIF files I am not getting the colour...
3
5977
by: Muddasir | last post by:
hi all i need to upload an image and if that image is coloured i need to convert it to black and white image ... till now i only uploaded images ... simple.. have no idea how to do this...
1
2559
by: John | last post by:
I have a switchboard and wish to add an image to the buttons via the switchboard table. I have added an extra column in the switchboard table with the names of embedded ico images corresponding to...
3
6761
by: srsaravanan | last post by:
i need coding for converting block and white image into RGB image
0
7094
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,...
0
7173
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...
1
6839
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...
0
7305
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
5427
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4559
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...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
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 ...
0
259
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.