How to extract the 256x256 icon from an icon and display it in .Net, Winforms, XP

Posted by Jules on Stack Overflow See other posts from Stack Overflow or by Jules
Published on 2010-03-18T09:32:19Z Indexed on 2010/03/18 10:11 UTC
Read the original article Hit count: 673

Filed under:
|
|
|
|

Here's the code that I use to extract the icon size that I want:

    Dim i As Icon = My.Resources.Spectrum
    Using i2 As New Icon(i, New Size(256, 256))
        Me.PictureBox1.Image = i2.ToBitmap
    End Using

This works from 16x16 up to 128x128 but for 256x256 it extracts the 128x128 icon. I tried 0x0, because I seem to remember that that is how the large size is stored in the meta data, but that didn't work either.

© Stack Overflow or respective owner

Related posts about Icons

Related posts about .NET