Meyka Jograt Meyka Jograt - 4 months ago 20
Vb.net Question

Save Blob Image with Width & Height VB.Net, MySQL

How can I save image with

Width & Height (360x480)
pixels.

So far this code helps me to convert the image in the
PictureBox
to save it in database.

Dim ms As New MemoryStream()
picImage.Image.Save(ms, ImageFormat.Png)
Dim pic_arr As Byte() = New Byte(ms.Length - 1) {}
ms.Position = 0
ms.Read(pic_arr, 0, pic_arr.Length)


How can I ADD the feature where I can set the Image Width & Height?

Answer

The Image object has Height and Width properties. Those are just numbers so you would save them to the database just like you would any other numbers.