我想保存显示在MS Access中PictureBox
中的图片,就我而言,我不想使用OpenFileDialog
方法(它对我来说很好用)。我只是想将软件启动时PictureBox1
中显示的默认图片存储到数据库中。问题是:它在数据库中存储了黑色图像,检索图像并将其显示在PictureBox
中时可以看到它。
部分代码:
Private Sub saveimage()
Try
Dim ms As New System.IO.MemoryStream
Dim bmpImage As New Bitmap(PictureBox1.Image)
bmpImage.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg)
bytImage = ms.ToArray()
ms.Close()
Catch ex As Exception
End Try
End Sub