I'm developing a project that includes a picture gallery managing by admin panel. I want to show thumbnail images to admin in the admin panel which is active and will be showing to end user.
Ok. I'm storing images into db in two parameters: ImageData(byte[]), ImageMimeType. So I want to store thumbnail versions of pictures at the when first time store images. I have found some example code to resize and manipulate pictures in this adress link text :
private static Image cropImage(Image img, Rectangle cropArea)
{
Bitmap bmpImage = new Bitmap(img);
Bitmap bmpCrop = bmpImage.Clone(cropArea,
bmpImage.PixelFormat);
return (Image)(bmpCrop);
}
this function taking a image as a parameter. But I have ImageData(byte[]).
So, How do I convert my byte array to Image and Image to byte array?