Referencing an embedded icon, convert to image?

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

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.
 
You can get embedded objects through the resource reader. See info on ResourceReader

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.
 
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 You can get embedded objects through the resource reader. See info on ResourceReader

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.
 
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
 
* "Erik Frey said:
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...
 
Back
Top