Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting access to bitmap in an ImageList or PictureBox 1

Status
Not open for further replies.

Fred48

Programmer
Feb 23, 2004
62
US

I'm in the process of replacing ActiveX ToolBar / ImageList
with the Toolbar / ImageList provided with the VB .Net 2003. The Bitmaps that were used originally to populate the imagelist are nowhere to be found.

Is there a way to extract the bitmaps that are in the old imagelist back out to a .bmp file that can be used or to the new ImageList?

Is there a way to extract bitmaps that have been placed in a PictureBox????
 
Try this. I am using vb 2005 express but it should be about the same.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'=========================================
' Save images in an ImageList
'=========================================
Dim bmp As Bitmap = Nothing
For i As Integer = 0 To ImageList1.Images.Count - 1
bmp = ImageList1.Images(i)
bmp.Save("c:\Image" & i & ".bmp", Imaging.ImageFormat.Bmp)
Next i
End Sub


Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'=========================================
' Save images in a picturebox
'=========================================
PictureBox1.Image.Save("c:\picturebox.bmp", Imaging.ImageFormat.Bmp)
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top