locked
Problem with GDI RRS feed

  • Question

  • User978199127 posted
    Got this problem(see code below)... when I put some drawing on the site I got lose of all of the rest content(tables, text, anything...), what i do wrong or what i dont know pls help...thx <%@ Page Language="VB" Debug="true" %> <%@ Import Namespace="System.Drawing" %> <%@ Import Namespace="System.Drawing.Imaging" %> <%@ Import Namespace="System.Drawing.Drawing2d" %> <script runat="server"> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) If Not Page.IsPostBack Then Dim b As New Bitmap(200, 200, pixelformat.Format32bppRgb) Dim p As New Pen(Color.DodgerBlue) Dim g As Graphics = Graphics.FromImage(b) Dim br As Brush = Brushes.LawnGreen g.FillEllipse( br, 1, 1, 198, 198 ) Response.ContentType = "image/gif" b.Save(Response.OutputStream, ImageFormat.Gif) b.Dispose() End If End Sub </script> <IMG src="rezultat.aspx> ' i put here anything and it does not apear
    Friday, February 27, 2004 2:31 AM

All replies

  • User978199127 posted
    Ok problem solved...;)
    Friday, February 27, 2004 5:17 AM
  • User863538163 posted

    How did you solve this? I'm having the same problem!

     

    Thanks,
    Matei

    Thursday, July 13, 2006 4:03 PM
  • User863538163 posted

    How did you fix this? I'm having the same problem...

     

    Thanks,
    Matei

    Thursday, July 13, 2006 4:03 PM
  • User1900948409 posted
    it's because he's writing the image out to the output stream on the same page. the browser ignores everything else because he's saying the output type is an image, it renders that and it's finished.

     the appropriate way to solve this is to create another aspx page, set the img url property to be that page and on that page output the image.
    Saturday, July 15, 2006 4:04 PM
  • User863538163 posted

    Hi,

    Thanks for the reply, I wrote a custom handler that handles my images now.

    Cheers
    Matei

    Monday, July 17, 2006 3:55 PM