[英]Display Camera Image in VS PictureBox W/0 Saving To PC Drive
如果我將從相機傳輸的圖像保存(到磁盤上),則可以在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代碼方式顯示傳輸的圖像。 而不保存到磁盤
您可以從物理位置顯示圖像,例如
Picturebox1.Image=Image.FromFile("Path");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.