473,499 Members | 1,889 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(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 embedded icon
to an image.

Any help appreciated. TIA.

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

"news.microsoft.com" <no*****@nothanks.com> wrote in message news:OE**************@TK2MSFTNGP10.phx.gbl...
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 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*****@nothanks.com> wrote in message news:OE**************@TK2MSFTNGP10.phx.gbl...
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 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**************@TK2MSFTNGP10.phx.gbl...
You can get embedded objects through the resource reader. See info on ResourceReader

"news.microsoft.com" <no*****@nothanks.com> wrote in message news:OE**************@TK2MSFTNGP10.phx.gbl...
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 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**************@TK2MSFTNGP10.phx.gbl...
You can get embedded objects through the resource reader. See info on ResourceReader

"news.microsoft.com" <no*****@nothanks.com> wrote in message news:OE**************@TK2MSFTNGP10.phx.gbl...
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 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.FromHicon(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.FromHicon(myIcon.Handle)

Erik
Nov 20 '05 #7
* "Erik Frey" <er*******@hotmail.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.FromHicon(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*******@hotmail.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.FromHicon(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
7630
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
1692
by: Arda Coskun | last post by:
Hi, How to create embedded graphics and audios? Any article would be helpful. Kind regards,
3
21626
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:...
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...
8
957
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...
11
5545
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...
6
10963
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: ...
1
3885
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...
4
5003
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...
0
7012
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
7225
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
6901
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
7392
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
4605
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
3105
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...
0
3101
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1429
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 ...
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.