新聞中心
這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
VB.NET二進(jìn)制圖像獲取方式介紹
VB.NET編程語言在圖像的處理方面是比較實(shí)用的。我們可以通過本文介紹的關(guān)于VB.NET二進(jìn)制圖像獲取的方式對(duì)這一知識(shí)點(diǎn)進(jìn)行詳細(xì)的解讀。首先讓我們一起來看看具體的代碼編寫方式。#t#

從 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)) Then- index = &H4E
- Do While (index < (ImageStream.
Length - 1))- If ((ImageStream(index) = &H42)
AndAlso (ImageStream((index +
1)) = &H4D)) Then- Exit Do
- End If
- index += 1
- Loop
- If ((ImageStream(index) <> &H42)
OrElse (ImageStream((index
+ 1)) <> &H4D)) Then- index = &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
VB.NET二進(jìn)制圖像的相關(guān)讀取方式就為大家介紹到這里。
文章名稱:VB.NET二進(jìn)制圖像獲取方式介紹
文章地址:http://fisionsoft.com.cn/article/dpccpih.html


咨詢
建站咨詢
