If you have an image file, then:
PictureBox1.ImageLocation = "C:\SomeFolder\MyImage.png"
The stream is not needed.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello all I'm gonna use this method to embed a small 16x16 transparent png to my custom control:
Dim PictureStream As New IO.MemoryStream(New Byte() _
{&H89, xxxxxxxxxxxxxx})
PictureBox1.Image = New Drawing.Bitmap(PictureStream)
PictureStream = Nothing
However, don't know how to get the MemoryStream from my png icon on disc? Any idea? Thanks
output is expected to be like: -with or without {}
> {&H89, &H50, &H4E, &H47, &HAE, &H42, &H60, &H82}
> ```
>
>
If you have an image file, then:
PictureBox1.ImageLocation = "C:\SomeFolder\MyImage.png"
The stream is not needed.
Hi @S-Soft , Try using Image.FromStream Method
Dim image As Image = Image.FromStream(ms)
PictureBox1.Image = image
Best Regards.
Jiachen Li
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.