0

I need to convert image from one format, some big format, to some lite format like jpg or any other.

I am using winforms, C#. What class is best for this job, and any suggestion what is a good way to do this?

I find Imagemagic. I guess it's the right way to do this.

tanasi
  • 1,804
  • 6
  • 37
  • 53

1 Answers1

3

What format are you converting from? If it's bitmaps and you don't need fine-grained control over the image, just use the built in conversions:

using (Image img = Image.FromFile(@"c:\pic.bmp")) {
     img.Save(@"c:\pic.jpg" ,ImageFormat.Jpeg); 
}
Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
stuartd
  • 70,509
  • 14
  • 132
  • 163
  • I am not sure jet which format that will be, but lets say it will be format directly from memory card, I guess than it is bitmap. But I have to put water mark to image too. – tanasi Mar 04 '11 at 12:15
  • For watermark, see eg http://stackoverflow.com/questions/1224653/place-watermark-image-on-other-images-c-asp-net – stuartd Mar 04 '11 at 13:32