Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I need a way to extract an 8-bit icon from a file, specifically an exe.

 

I've tried using ExtractAssociatedIcon, but that only extracts 32-bit icons, and I have not found a way to convert it to 8-bit.

 

Thanks!

grantman16

Posted

Hey,

 

Thanks for your help, but I ended up setting the background image of the form to a screenshot of the screen behind it and laying the icon on top of that, creating the illusion that the alpha regions are overlaying the screen behind it. It works flawlessly for the application I'm developing.

 

In case you're wondering, here's the code I used:

 

Me.Visible = False
Dim bounds As Rectangle = Me.Bounds ' Form border should be set to None
Dim screenshot As New Bitmap(bounds.Width, bounds.Height, Imaging.PixelFormat.Format32bppArgb)
Dim g As Graphics = Graphics.FromImage(screenshot)
g.CopyFromScreen(bounds.Location, New Point(0, 0), bounds.Size, CopyPixelOperation.SourceCopy)
Me.BackgroundImage = screenshot
Me.Visible = True

 

- grantman16

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...