CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2003
    Location
    Sweden
    Posts
    381

    Compress an Image to a small JPEG

    My program uses a lot of pictures (from screendumps) and I need to compress those so that my program uses less memory. Any idea how to do that in C#?
    ...and justice for all

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Compress an Image to a small JPEG

    Have you tried simply saving the image as a JPEG ( from your program ) ¿

    Something like :
    Code:
    Image.Save(ImageName, ImageFormat.Jpeg)

  3. #3
    Join Date
    Oct 2003
    Location
    Sweden
    Posts
    381

    Re: Compress an Image to a small JPEG

    I'm doing just that.

    I want something like:

    Code:
    Image.Save(ImageName, ImageFormat.Jpeg, 10 /*compression*/)
    ...and justice for all

  4. #4
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Compress an Image to a small JPEG

    I thought you have talked about BMP files, because of your mentioning of screenshots

    Jpegs are usually small, but what you can do is to follow the advice given here :
    http://msdn.microsoft.com/en-us/library/bb882583.aspx

  5. #5
    Join Date
    Oct 2003
    Location
    Sweden
    Posts
    381

    Re: Compress an Image to a small JPEG

    Perfect!! Thanks!
    ...and justice for all

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured