Results 1 to 2 of 2

Thread: Why there is an error when using Bitmap.save(Response.StreamOutPut,ImageFormat.Png)?

  1. #1

    Thread Starter
    Lively Member Yok's Avatar
    Join Date
    Feb 2001
    Location
    Guangzhou,China
    Posts
    72

    Why there is an error when using Bitmap.save(Response.StreamOutPut,ImageFormat.Png)?

    How to save png format to Response.OutPutStream?

    Here's the error detail:
    Exception Details: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.

    Source Error:


    Line 31:
    Line 32: g.DrawString("Hi!",new Font ("Arial",23),new SolidBrush (Color.Blue ),3,3);
    Line 33: bmp.Save (Response.OutputStream,ImageFormat.Png );
    Line 34:
    Line 35:

  2. #2
    Addicted Member Dmyze's Avatar
    Join Date
    Mar 2002
    Location
    Seattle
    Posts
    160
    I'm not sure if this is the answer, but here is some code I have that works.

    Code:
        Response.ContentType = "image/gif"
        imgOutput.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg)
    -Daryl
    "Two More Rolls of Duct tape, and the world is mine!"
    VB.NET Guru

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