Save image file from Byte array
Gents,
I have this code which saves an "Image" to a SQL Server database:
vb.net Code:
'You have the images in the PictureBoxes, now you need to store it as a Reference Image
'if the user has selected that option
Dim ms2 As New MemoryStream()
'Save the image to the MemoryStream
DirectCast(CameraTable.Controls("camera" & z.ToString), PictureBox).Image.Save _
(ms2, Imaging.ImageFormat.Bmp)
Dim arrImage() As Byte = ms2.GetBuffer
db.SaveReferenceImage(arrImage, z)
This basically stores a long string of text in the DB such as:
"0x0asdfwerlkjfasfalskdfjsfj.."
I am working on a PHP site at the moment that is having trouble reading that data to display the image, so I am attempting to not only save it to the DB, but also save it as a bitmap or other file type to the actual server.
How can I create an image file (not really picky on which file type) from the "arrImage()" data above?
Re: Save image file from Byte array
Here's an example I wrote a while ago:
http://www.vbforums.com/showpost.php...95&postcount=4
The example converts the image to and from a Base64String but you should be able to easily modify it to suit your needs.