2015-10-22 134 views
0

如果我保存(磁盘)从摄像机传输的图像,吾人可以在PictureBox显示它,如下:显示摄像机图像

Dim picNum As Integer = 1 
Dim imgName As String 
Dim imgExt As String 
Dim WiaDialog1 As New WIA.CommonDialog 
Dim WiaDevice1 As WIA.Device = WiaDialog1.ShowSelectDevice(WIA.WiaDeviceType.CameraDeviceType, False, False) 
imgName = WiaDevice1.Items(picNum).Properties("Item Name").Value 
imgExt = "." & WiaDevice1.Items(picNum).Properties("Filename extension").Value 
Dim image1 As WIA.ImageFile = WiaDevice1.Items(picNum).Transfer(WIA.FormatID.wiaFormatPNG) 
image1.SaveFile("C:\PhotoSort\CameraNew2\" & imgName & imgExt) 
image1 = "C:\PhotoSort\CameraNew2\" & imgName & imgExt" 
PictureBox1.Image = image1 

我想以类似的VB代码方式显示传输的图像。没有它保存到磁盘

回答

0

您可以从物理位置一样

Picturebox1.Image=Image.FromFile("Path"); 
+0

谢谢显示图像。那么这个物理位置是否会被引导回相机?如FromFile(相机的DCIM文件夹中的文件名?)或者至少是某处不在磁盘上。 – MichealB

相关问题