Help in coverting image formats

Discussion in '.NET' started by MostafaSayed, Jun 25, 2007.

  1. MostafaSayed

    MostafaSayed

    Joined:
    Jun 25, 2007
    Messages:
    2
    I work in image processing program (Windows Application) and I have a problem in converting image from format to another.
    The first problem
    I converted the Image file to Icon through 2 ways but still have problems these 2 ways are:
    1-
    Bitmap icon =new Bitmap (ImagePath);
    icon.Save(targetfilename, ImageFormat.Icon);
    This way don't work correctly
    2-
    Bitmap bitmap = new Bitmap(ImagePath);
    Icon ico = Icon.FromHandle(bitmap.GetHicon());
    FileStream fs = new FileStream(targetfilename, FileMode.OpenOrCreate);
    ico.Save(fs);
    fs.Close();
    This way make colors of the output icon change.
    How can I convert this type?

    The second problem:
    When I convert to gif file as follow:
    Bitmap bitmap = new Bitmap(ImagePath);
    bitmap.Save(targetFileName, ImageFormat.Gif);
    This way make low resolution, and if the source image doesnot have background, the output file will be with background in the converted formats (.Gif, .Bmp, .Jpeg)
    How can I convert this type?


    The third problem:
    The formats Wmf, Exif, Emf donot have Encoder.
    How can I convert them?

    Please tell me wat is the wrong in my code
     
    MostafaSayed, Jun 25, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jahaya@gmail.com

    Coverting WAV file to ASCII

    jahaya@gmail.com, Apr 7, 2005, in forum: VHDL
    Replies:
    4
    Views:
    14,162
    Jonathan Bromley
    Apr 8, 2005
  2. JVSFugitive

    Coverting Ascii Hexidecimal Number

    JVSFugitive, Nov 3, 2004, in forum: Java
    Replies:
    3
    Views:
    3,384
    Thomas Weidenfeller
    Nov 3, 2004
  3. niels

    Coverting xml to PDF

    niels, Sep 12, 2003, in forum: XML
    Replies:
    1
    Views:
    404
  4. MostafaSayed

    Help in coverting image formats

    MostafaSayed, Jun 25, 2007, in forum: .NET
    Replies:
    0
    Views:
    358
    MostafaSayed
    Jun 25, 2007
  5. James Leech

    Help Coverting Access Function to ASP Function

    James Leech, Jan 14, 2005, in forum: ASP General
    Replies:
    1
    Views:
    143
    Bob Barrows [MVP]
    Jan 14, 2005
Loading...

Share This Page