You could do it like this. Google is full of answers you know. You might have to add some references. Just right click on the error if there is one.
C#
private void IconToBitmap(PaintEventArgs e)
{
// Construct an Icon.
Icon icon1 = new Icon(SystemIcons.Exclamation, 40, 40);
// Call ToBitmap to convert it.
Bitmap bmp = icon1.ToBitmap();
// Draw the bitmap.
e.Graphics.DrawImage(bmp, new Point(30, 30));
}
vb.net
Private Sub IconToBitmap(ByVal e As PaintEventArgs)
' Construct an Icon.'
Dim icon1 As New Icon(SystemIcons.Exclamation, 40, 40)
' Call ToBitmap to convert it.'
Dim bmp As Bitmap = icon1.ToBitmap()
' Draw the bitmap.'
e.Graphics.DrawImage(bmp, New Point(30, 30))
End Sub