hi,k.
this size of icon depend on your width and height of picturebox1.
ying,he.

2010/2/16, K <[email protected]>:
> Hi all,  I am using Visual Basic 2008.  I have Visual Basic code (see
> below) which changes the Form icon image with PictureBox image.  My
> question is that what code line I should use in code below that I can
> save this icon on a path in different sizes like 16 x 16 or 32 x 32
> etc.  Please can any friend can help
>
>
>     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
> As System.EventArgs) Handles Button1.Click
>         Dim img As New Bitmap(PictureBox1.Image)
>         Dim g As Graphics = Graphics.FromImage(img)
>         g.DrawImage(img, 0, 0)
>         Dim Hicon As IntPtr = img.GetHicon
>         Dim newicon As Icon = System.Drawing.Icon.FromHandle(Hicon)
>         Me.Icon = newicon
>         DestroyIcon(newicon.Handle)
>     End Sub
>

Reply via email to