كيف احول من
byte() array
الى
image
كيف احول من
byte() array
الى
image
Dim rs As SqlClient.SqlDataReader Dim mPic As Object
Dim mCom As New SqlClient.SqlCommand("Select * from pixs ", Conn)
rs = mCom.ExecuteReader()
rs.Read()
Dim bytes() As Byte = CType(rs("Pic"), Byte())
Dim imgStream As MemoryStream = New MemoryStream(bytes)
Dim img As Image = Image.FromStream(imgStream)
PicBox.Image = img
this code is sql code i need to make function take (byte() array ) then return image and thnx for helping me :D
Public Function ReturnImage(ByVal mByte As Byte()) As Image
Dim bytes() As Byte = CType(mByte, Byte())
Dim imgStream As MemoryStream = New MemoryStream(bytes)
Dim img As Image = Image.FromStream(imgStream)
imgStream = Nothing
bytes = Nothing
Return img
End Function
شكرا شكرا شكرا شكرا شكرا شكرا شكرا شكرا شكرا
العفوو العففوو العفووو
ربنا معاك فى برنامج الى بتعملة :lol: