c# - A Generic Error Occurred in GDI +. Saving a BMP image -



c# - A Generic Error Occurred in GDI +. Saving a BMP image -

i have bmp image. have draw rectangles (more 1) on based on conditions. code i'm using.

using (image image = image.fromstream(stream)) { image.save(strfilenamebmp); stream.close(); } seek { image image = image.fromfile(strfilenamebmp); pen black = new pen(color.red, 4); using (graphics graphics = graphics.fromimage(image)) { graphics.drawrectangle(black, ix, iy, iw, ih); image.save(strfilenamebmp); // line } } grab (exception e) { }

problem 1- if seek save final image bmp, shows "a generic error occurred in gdi+".

problem 2- if seek save png in line a, overwrites image , can see on 1 rectangle. can help?

c# graphics

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -