Click here to Skip to main content
16,016,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using a jQuery cropper to resize the image. The cropper makes a canvas of resized image and I have saved the image using file stream successfully as following.
C#
using (FileStream fs = new FileStream(avatarPath, FileMode.Create))
                {
                    using (BinaryWriter bw = new BinaryWriter(fs))
                    {
                        byte[] data =Convert.FromBase64String(imageCanvas);
                        bw.Write(data);
                        bw.Close();
                    }
                    fs.Close();
                }

But the main issue is that the size of the newly saved image is 3-4 times of the original image.

Any suggestion, thanks in advance.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900