We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage PictureBox1.Image = GetImageFromFileStream(fs, 0, 4566) End Sub Public Function GetImageFromFileStream(ByVal FileStream As System.IO.FileStream, ByVal Offset As Int32, ByVal Length As Int32) As System.Drawing.Image Dim Image As System.Drawing.Image = Nothing FileStream.Seek(Offset, System.IO.SeekOrigin.Begin) Dim BinaryReader As System.IO.BinaryReader = New System.IO.BinaryReader(FileStream) Dim ImageLength As System.Int32 = Length Dim Buffer(ImageLength - 1) As System.Byte Dim BytesRead As System.Int32 = 0 BytesRead = FileStream.Read(Buffer, 0, Buffer.Length) If BytesRead = Buffer.Length Then Dim MemoryStream As System.IO.MemoryStream = New System.IO.MemoryStream(Buffer) Image = System.Drawing.Image.FromStream(MemoryStream).Clone MemoryStream.Close() MemoryStream.Dispose() End If Return Image End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.