GDI Image::Save returns Win32Error
I am using GDI Image::Save Method to save the images to the file in my Application. I am getting Win32Error (7) status error in few instances with Vista 64 bit. It is working fine with vista 32 bits. and also this problem is coming randomly .
Can you please suggest how to solve the problem
Thanks in advance
Regard开发者_运维技巧s Subbi Reddy
One possible case when this is happening is when the image's underlying stream has been closed:
using ( var fs = new FileStream( filename, FileMode.Open ) )
bmp = (Bitmap)Image.FromStream( fs );
If you now try to save bmp this error can occur. Your problem may, of course, be something completely different.
You could, however, try to save a copy of your image instead of saving the image directly, like so:
using ( var tempBitmap = new Bimap( oldBitmap ) )
tempBitmap.Save( ...... );
精彩评论