الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

From Byte() To Image

بدأه EngAhmedVB.N في 15 مايو 2009 · 5 رد · 508 مشاهدة · في Microsoft Visual Basic.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

كيف احول من 

byte() array

الى

image

#3

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

#4

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

#5

شكرا شكرا شكرا شكرا شكرا شكرا شكرا شكرا شكرا

#6

العفوو العففوو العفووو

ربنا معاك فى برنامج الى بتعملة :lol:

مواضيع مشابهة