locked
Convert bitmap to gif RRS feed

  • Question

  • User-433496281 posted

     Hi all,

     when i convert gif to bitmap, my gif image's quality gets spoilt. I wanna reobtain my gif image from the bitmap  image which I converted from the gif image. I have sheached during the 2 hours. how can i reobtain gif from bitmap which is same quality.

     

    I really need a help.

     

     

     

    Friday, March 6, 2009 5:15 AM

Answers

  • User-1573772286 posted

    I don't really know, as I'm just learning, but try playing around with the MemoryStream property.  For example, to create a PNG file (which is considered the best type says my book):

     Response.ContentType = "image/png";

    //create the PNG in memory

    MemoryStream mem = new MemoryStream();

    image.Save (mem, System.Drawing.Imaging.ImageFormat.Png);  //note you save to mem, not to Response.OutputStream

    //wrote from mem to output stream

     mem.WriteTo(Response.OutputStream);

     So you can see here that you're saving to memory, which is faster, and maybe you don't lose the information you are losing (try it and see)

    If this helped please mark me as correct answer.

    MS

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 3, 2009 5:19 PM