Click here to Skip to main content
15,900,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am storing an image into database, but its binary data have more size. Due to this my database become heavy. Can i save it in fix size to reduce my database size?
Help me to compress image
Posted
Updated 2-Aug-15 23:39pm
v2

 
Share this answer
 
Comments
Member 11498882 3-Aug-15 7:15am    
my code is

void convertImage()
{
if (image_pictureBox.Image != null)
{
ms = new MemoryStream();
image_pictureBox.Image.Save(ms, ImageFormat.Jpeg);
byte[] photo_array = new byte[ms.Length];
ms.Position = 0;
ms.Read(photo_array, 0, photo_array.Length);
cmd.Parameters.AddWithValue("@A_IMAGE", photo_array);
}
}

how do I make here any change with your code
HI, please have a look at this article.
C#: Image resize, convert, and save[^]

This will help you to solve your problem.
 
Share this answer
 

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