c# - A Generic Error Occured in GDI+ when resizing image -


ok, creating photobooth application, , it's working.

i'm creating image base64 string i'm getting webcam jquery plugin, converting image using extension method, , trying save it. resolution of image default 320 wide 240 high.

here's code, works.

var image = model.base64string.toimage(); image.save("c:/photoroute/" + model.id + ".jpg", imageformat.jpeg); 

however, realized later needed change resolution 320px 426px.

all did change size of image being taken plugin, of c# code same, , yet i'm getting "generic error occurred in gdi+" error.

could problem of image maybe being large? else problem be?

i found way fix it, although i'm not 100% sure why worked.

i changed code this:

var image = model.base64string.toimage(); var resizedimage = new bitmap(image, new size(144, 192));  resizedimage.save("c:/photoroute/" + model.id + ".jpg", imageformat.jpeg); 

this worked, although not 100% sure why.

further answers appreciated!!


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -