您好,登錄后才能下訂單哦!
VB.NET中怎么獲取二進(jìn)制圖像,相信很多沒(méi)有經(jīng)驗(yàn)的人對(duì)此束手無(wú)策,為此本文總結(jié)了問(wèn)題出現(xiàn)的原因和解決方法,通過(guò)這篇文章希望你能解決這個(gè)問(wèn)題。
從 Byte() 中進(jìn)行VB.NET二進(jìn)制圖像的獲取
Public Function GetImage
FromStream
()Function GetImageFromStream
(ByVal ImageStream As Byte())
As Image
Me.mobjImage = Nothing
If (ImageStream Is Nothing)
Then
Return False
End If
Dim index As Integer = 0
If (((ImageStream(0) = &H15)
AndAlso (ImageStream(1) = &H1C))
AndAlso (ImageStream.Length
>= 80)) Thenindex = &H4E
Do While (index < (ImageStream.
Length - 1))If ((ImageStream(index) = &H42)
AndAlso (ImageStream((index +
1)) = &H4D)) ThenExit Do
End If
index += 1
Loop
If ((ImageStream(index) <> &H42)
OrElse (ImageStream((index
+ 1)) <> &H4D)) Thenindex = &H87
End If
End If
Try
Dim stream As New MemoryStream
(ImageStream, index,
(ImageStream.Length - index))objImage = Drawing.Image.
FromStream(stream)Catch obj1 As Exception
return nothing
End Try
Return objImage
End Function
看完上述內(nèi)容,你們掌握VB.NET中怎么獲取二進(jìn)制圖像的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。