Image to byte []
MemoryStream MS = New MemoryStream ();
IMAGEDATA = NULL;
Picturebox1.image.save (ms, system.drawing.image.imageformat.gif);
Imagedata = ms.getBuffer ();
Byte [] to image
System.drawing.Image img;
MemoryStream MS = New MemoryStream ();
MS = new system.io.MemoryStream ((byte []) content);
IMG = system.drawing.image.fromstream (ms);
IF (img.width> convert.toint32 (_width))
{
_WIDTH = 500;
_Height = (img.height * control.toint32 (_width) / img.width;
}
Else
{
_WIDTH = img.width;
_height = img.height;
}
img.dispose ();