473,566 Members | 3,255 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Referencing an embedded icon, convert to image?

I have an icon that I can reference by the following:

Dim im As System.Drawing. Image
im = im.FromFile(lsa pppath & "ChkMrk.ico ")
g_mainform.fg.S etCellImage(g_m ainform.FG.Row, 5, im)
The problem is that I do NOT want to reference this as "from file" - the icon is already
embedded in the program, but I can't seem to find a way to convert my embedded icon
to an image.

Any help appreciated. TIA.

Nov 20 '05 #1
8 959
You can get embedded objects through the resource reader. See info on ResourceReader

"news.microsoft .com" <no*****@nothan ks.com> wrote in message news:OE******** ******@TK2MSFTN GP10.phx.gbl...
I have an icon that I can reference by the following:

Dim im As System.Drawing. Image
im = im.FromFile(lsa pppath & "ChkMrk.ico ")
g_mainform.fg.S etCellImage(g_m ainform.FG.Row, 5, im)
The problem is that I do NOT want to reference this as "from file" - the icon is already
embedded in the program, but I can't seem to find a way to convert my embedded icon
to an image.

Any help appreciated. TIA.

Nov 20 '05 #2
You can get embedded objects through the resource reader. See info on ResourceReader

"news.microsoft .com" <no*****@nothan ks.com> wrote in message news:OE******** ******@TK2MSFTN GP10.phx.gbl...
I have an icon that I can reference by the following:

Dim im As System.Drawing. Image
im = im.FromFile(lsa pppath & "ChkMrk.ico ")
g_mainform.fg.S etCellImage(g_m ainform.FG.Row, 5, im)
The problem is that I do NOT want to reference this as "from file" - the icon is already
embedded in the program, but I can't seem to find a way to convert my embedded icon
to an image.

Any help appreciated. TIA.

Nov 20 '05 #3
CJ --

Um, well, thanks, but that still doesn't help me. A real-life example would be appreciated.
"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message news:Oi******** ******@TK2MSFTN GP10.phx.gbl...
You can get embedded objects through the resource reader. See info on ResourceReader

"news.microsoft .com" <no*****@nothan ks.com> wrote in message news:OE******** ******@TK2MSFTN GP10.phx.gbl...
I have an icon that I can reference by the following:

Dim im As System.Drawing. Image
im = im.FromFile(lsa pppath & "ChkMrk.ico ")
g_mainform.fg.S etCellImage(g_m ainform.FG.Row, 5, im)
The problem is that I do NOT want to reference this as "from file" - the icon is already
embedded in the program, but I can't seem to find a way to convert my embedded icon
to an image.

Any help appreciated. TIA.

Nov 20 '05 #4
CJ --

Um, well, thanks, but that still doesn't help me. A real-life example would be appreciated.
"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message news:Oi******** ******@TK2MSFTN GP10.phx.gbl...
You can get embedded objects through the resource reader. See info on ResourceReader

"news.microsoft .com" <no*****@nothan ks.com> wrote in message news:OE******** ******@TK2MSFTN GP10.phx.gbl...
I have an icon that I can reference by the following:

Dim im As System.Drawing. Image
im = im.FromFile(lsa pppath & "ChkMrk.ico ")
g_mainform.fg.S etCellImage(g_m ainform.FG.Row, 5, im)
The problem is that I do NOT want to reference this as "from file" - the icon is already
embedded in the program, but I can't seem to find a way to convert my embedded icon
to an image.

Any help appreciated. TIA.

Nov 20 '05 #5
>Um, well, thanks, but that still doesn't help me. A real-life example would
be appreciated.

Dim myIcon As Icon = New System.Drawing. Icon(Me.GetType ,
"MyEmbeddedIcon .ico")
Dim myBitmap As Bitmap = Bitmap.FromHico n(myIcon.Handle )

Erik
Nov 20 '05 #6
>Um, well, thanks, but that still doesn't help me. A real-life example would
be appreciated.

Dim myIcon As Icon = New System.Drawing. Icon(Me.GetType ,
"MyEmbeddedIcon .ico")
Dim myBitmap As Bitmap = Bitmap.FromHico n(myIcon.Handle )

Erik
Nov 20 '05 #7
* "Erik Frey" <er*******@hotm ail.com> scripsit:
Um, well, thanks, but that still doesn't help me. A real-life example would

be appreciated.

Dim myIcon As Icon = New System.Drawing. Icon(Me.GetType ,
"MyEmbeddedIcon .ico")
Dim myBitmap As Bitmap = Bitmap.FromHico n(myIcon.Handle )


Alternatively it may be the preferred way to store a bitmap instead of
the icon...

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #8
* "Erik Frey" <er*******@hotm ail.com> scripsit:
Um, well, thanks, but that still doesn't help me. A real-life example would

be appreciated.

Dim myIcon As Icon = New System.Drawing. Icon(Me.GetType ,
"MyEmbeddedIcon .ico")
Dim myBitmap As Bitmap = Bitmap.FromHico n(myIcon.Handle )


Alternatively it may be the preferred way to store a bitmap instead of
the icon...

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #9

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

Similar topics

5
7645
by: [Yosi] | last post by:
I have a form , I want to change form icon relate to some states, I all image list witch include some icons. How can I convert image to Icon or how to change the form icon ....in run time
4
1700
by: Arda Coskun | last post by:
Hi, How to create embedded graphics and audios? Any article would be helpful. Kind regards,
3
21640
by: Stanley | last post by:
I wish to set Form.Icon from an image list but seems like the image list didn't provide a method to extract the image as an Icon type. Thus, can anyone show me a way the conversion From: System.Drawing.Image To: System.Drawing.Icon Or show me an easy way to set the Form.Icon from an image list. Thanks and have a nice day.
8
440
by: Wayne Hoover | last post by:
I have an embedded icon resource in my project - I need to reference this icon for a grid cell. I've tried using the following but it does not work. Any help appreciated: Dim im As System.Drawing.Image im = CType(getobject("CHECKMRK.ICO"),System.Drawing.Image) <-- Fails here. g_mainform.fg.SetCellImage(g_mainform.FG.Row, 5, im)
8
3985
by: news.microsoft.com | last post by:
I have an icon that I can reference by the following: Dim im As System.Drawing.Image im = im.FromFile(lsapppath & "ChkMrk.ico") g_mainform.fg.SetCellImage(g_mainform.FG.Row, 5, im) The problem is that I do NOT want to reference this as "from file" - the icon is already embedded in the program, but I can't seem to find a way to convert my...
11
5568
by: Garrett | last post by:
I'm fairly new to VB .NET and programming in general, and I want to give my program its own icon without it being a separate file. I have the icon as part of the project, and its Build Action is set to Embedded Resource. I've searched high and low for the code that will actually make it load as the program's default icon, but nothing I've...
6
10986
by: Udi | last post by:
Hi, I have an imagelist initialized in design time with several icons files (.ico). However, when I need to extract an icon (Image) from the Imagelist, I can't convert it back to an icon: statusBarPanel1.Icon = imageList1.Images; // cast/as don't work // Cannot convert type 'System.Drawing.Image' to 'System.Drawing.Icon' What am I...
2
3824
by: Tom | last post by:
I need to be able to reference some images stored in my VB.NET program. Normally, I would load the images into an ImageList control and use them from there (these are going to be icons). However, I need to be able to add/delete images from this image 'store' (whatever I end up using); but because an image list only allows referencing by image...
1
3894
by: =?Utf-8?B?U3RldmVU?= | last post by:
I have a structure that contains both 32x32 and 16x16 icons plus some text. I want to write all this to an XML file so that I can recover the icons later in an application. Can someone tell me how to properly serialize the System.Drawing.Icon structure to an XML file? The following code doesn't write the icon information to the xml file. ...
4
5011
by: Marcolino | last post by:
Hi, I have simple needs but I don't know how to implement it. I have application that create Dynamic Button. I need to set the image on this button, getting the icon from a form. So pratically I need to convert dinamically a Form.Icon to Button.Image runtime, but i don't know how. Any help would be appreciated. Many Thanks
0
7673
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...
0
7584
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...
0
7953
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...
0
6263
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5485
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...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2085
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
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
926
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.