Closed Firas-Shrourou closed 4 years ago
Just create a new bitmap from the scaled image and use it for the memory stream.
Additionally, in order to support more image formats replace ImageFormat.Jpeg
with scaledImage.RawFormat
:
using (var ms = new MemoryStream())
{
var bm = new Bitmap(scaledImage);
bm.Save(ms, scaledImage.RawFormat);
using (ms)
{
// ...
}
bm.Dispose();
}
I'll close this issue since I think the problem is solved, feel free to reopen if you need more help,
Regards, Ziya
A problem when saving the scaled image to memory stream