This project is read-only.


Attempted to divide by Zero. Jpeg Encoder.


Hi, I'm trying to encode my canvas to a jpeg.
But i got an exception "Attempted to divide by Zero." when i call the Encode method of the jpegEncoder.
I added
in my App.xaml.cs in Application_Startup.
How can I fix this? And is there a way to pass the image to a web service without writing it to client's local disc? Thank you.
Closed Feb 24, 2011 at 8:07 AM by malignate88


malignate88 wrote Jan 12, 2010 at 12:35 PM

Fixed in the latest version. Not in the release.

wrote Jan 12, 2010 at 12:36 PM

abt wrote Jan 12, 2010 at 12:57 PM

Hi, thanks for the reply. I have another question, how can I write the png file to the disk without opening the safe file dialog. I tried to pass a StreamWriter object to the encode method, but it doesn't work. Thanks.

malignate88 wrote Jan 12, 2010 at 3:30 PM

Please ask ur question in the forum.

wrote Feb 24, 2011 at 8:07 AM

Resolved with changeset 61911.

wrote Feb 22, 2013 at 12:53 AM

wrote May 16, 2013 at 12:21 PM

Swinburne wrote Mar 25, 2014 at 4:18 AM

How about using jpeg 2000 codec that is a standard image compression solution widely used for archiving, distribution and screening and has many advantages over the old JPEG Standard, including both the encoder and decoder