wtuqi
2/29/2020 - 7:02 AM

图片加载到Picturebox(二进制方式读取)

        Using fs As FileStream = File.OpenRead("C:\Users\Administrator\Desktop\QQ202002291311_OCR\1.jpg")
            Dim Binary As Byte()
            ReDim Binary(CInt(fs.Length - 1))
            fs.Read(Binary, 0, CInt(fs.Length - 1))
            PictureBox1.Image = Image.FromStream(fs) '二进制加载图片
            Dim buffer As New MemoryStream(Binary)
            buffer.Position = 0 '指针起始位
            PictureBox1.Image = Image.FromStream(buffer) '内存流加载
        End Using