CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2006
    Location
    Graz, Austria
    Posts
    273

    Bitmap to Jpeg converter

    Hello all,

    I need help, I can't find a way to convert bitmap to gif file, but in memory, not saving on disc.
    I tried to convert my image using Microsoft encoder, but the image seems to be impossible to convert.

    What I also tried: I created a bitmap from my metafile, save it on disc, used a tool to convert it to gif which I saved also on disc and then pass it to my report (Image.FromFile(gif file path))- and everything was fine. I receive in my report a metafile, and I need to be a gif without any disc savings.

    Thanks,
    Daniela
    Daniela
    ******
    I would love to change the world, but they won't give me the source code

  2. #2
    Join Date
    Jan 2007
    Posts
    491

    Re: Bitmap to Jpeg converter

    Well, You could always temporarily save on disk the image in the wanted format, and then read its content and delete the file:
    http://msdn.microsoft.com/en-us/libr...=vs.90%29.aspx

  3. #3
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,016

    Re: Bitmap to Jpeg converter

    Probably MemoryStream (msdn link) might help you do this.
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  4. #4
    Join Date
    Aug 2008
    Posts
    2

    Re: Bitmap to Jpeg converter

    Daniela,
    If you want to do it like Talikag suggested, there are many libraries and utilities that perform the conversion (file to file). For example, there's a free command line tool we provide that performs image conversion among a few dozen files formats. You can find the converter here: http://www.leadtools.com/downloads/d...?category=free

    However, if you want to do the conversion in memory without having to save to disk, or you require more control over the load/save, you might want to look at the commercial imaging toolkit.
    Last edited by LEADTOOLS Support; May 11th, 2012 at 10:15 AM. Reason: repaired the broken url

  5. #5
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,016

    Re: Bitmap to Jpeg converter

    I would advise against use of commercial image manipulation toolkits; there are plenty of fully-featured free, open-source ones. The best example is ImageMagick (http://www.imagemagick.org/script/index.php) and its C# bindings: https://imagemagick.codeplex.com/
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

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