Professional Web Applications Themes

bitmap onto a webpage - ASP.NET General

I have a need to display a bitmap (chart) that has been created in code. In the Windows I just place it in a picturebox. But no luck with a Web page and I would like to be able to do it without writing the bmp to a file and then putting it back into the web page. Does anyone have an idea around this. Bob Brand...

  1. #1

    Default bitmap onto a webpage

    I have a need to display a bitmap (chart) that has been created in code. In
    the Windows I just place it in a picturebox. But no luck with a Web page
    and I would like to be able to do it without writing the bmp to a file and
    then putting it back into the web page.

    Does anyone have an idea around this.

    Bob Brand


    Microsoft Guest

  2. #2

    Default Re: bitmap onto a webpage

    You can look into system.drawing.image
    save(Response.OutputStream, ImageFormat.Jpeg) method. You might want a bmp
    format, but this "writes" the image out to a memory stream instead of disk.

    "Microsoft" <com> wrote in message
    news:phx.gbl... 
    In 


    vMike Guest

  3. #3

    Default Re: bitmap onto a webpage

    You need to create an ASP.Net page to write the image to the browser. The
    page can take a Bitmap object, and invoke the Save method to write the
    Bitmap to the Response.OutputStream. The example below writes the image in
    Jpeg Format. Note that you must set the Response.ContentType to the
    appropriate MIME Type for the ImageFormat you use. This informs the browser
    what MIME type it's getting, as the file extension (.aspx) won't help:

    Response.ContentType = "image/jpg";
    ImageObject.Save(Response.OutputStream, ImageFormat.Jpeg);

    You can then reference your ASP.Net page in an Image tag in any page;

    <img src="ShowImage.aspx">

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Neither a follower nor a lender be.

    "Microsoft" <com> wrote in message
    news:phx.gbl... 
    In 


    Kevin Guest

  4. #4

    Default Re: bitmap onto a webpage

    Jos

    Thanks you did the trick.

    Bob Brand
    "Jos" <fm> wrote in message
    news:phx.gbl... 
    >
    > Creating graphics on the fly, look here:
    > http://www.15seconds.com/issue/020924.htm
    >
    > --
    >
    > Jos Branders
    >
    >[/ref]


    Microsoft Guest

Similar Threads

  1. Replies: 0
    Last Post: November 23rd, 04:58 AM
  2. bitmap images
    By mr greeze in forum Adobe Indesign Macintosh
    Replies: 35
    Last Post: September 13th, 08:53 AM
  3. How to cut out bitmap ???
    By nguyentuananh in forum Macromedia Flash Ad Development
    Replies: 1
    Last Post: February 22nd, 07:38 PM
  4. Exporting as bitmap
    By n8w in forum Macromedia Freehand
    Replies: 3
    Last Post: July 30th, 11:17 AM
  5. Add a Bitmap ???
    By Robert in forum ASP.NET General
    Replies: 3
    Last Post: July 8th, 02:56 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139