Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Save Icon in different sizes

4 views
Skip to first unread message

K

unread,
Feb 16, 2010, 4:31:18 AM2/16/10
to
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

0 new messages