C# Image Processing :
I import .jpg to database
with BitMap Object to byte
Bitmap bm = new Bitmap(imagePath);
FileInfo fileInfo = new FileInfo(imagePath);
MemoryStream ms = new MemoryStream();
byte byteImage = ms.GetBuffer();
then Export byte to .jpg
Stream str = new MemoryStream((Byte)dr);
Bitmap bm= new Bitmap(str);
bm.Save(imagePath + "//" + this._lisrImageAll[id].imageName, System.Drawing.Imaging.ImageFormat.Jpeg);
But!!!! size of image not equal ,
Help me Please ,Thank you very much
If you mean that the size goes from say 9kb to 8kb then that's expected since you compress using jpeg when saving, which probably won't result in the exact same image.
Why do you have to convert the image type? Can't you just save the jpg as it is, using System.IO.File.ReadAllBytes and System.IO.File.WriteAllBytes?
Originally Posted by Magos
Thanks for answer, I will try
I'm programming Viewer and compare Image ,The DB for storing images.
image to be used to compare the image stored in the DB. That the same?
(weidth,heigth,size[byte]) Is true Not Import :)