I have an .aspx page (asp.net) with the following code:
<%@ Page ContentType = "image/gif"%>
<%@ Import Namespace = "System.Drawing" %>
<%@ Import Namespace = "System.Drawing.Imaging" %>
<Script Runat = "Server">
Sub Page_Load
Dim objBitmap As Bitmap
Dim objGraphics As Graphics
objBitmap = New Bitmap(200, 200)
objGraphics = Graphics.FromImage(objBitmap)
objGraphics.DrawLine(new Pen(Color.Red), 0, 0, 200, 200)
objBitmap.Save(Response.OutputStream, ImageFormat.Gif)
objBitmap.Dispose()
objGraphics.Dispose()
End Sub
</Script>
But what shows up on the page is junk text - strange characters, as follows:
GIF89a���3f���++3+f+�+�+�UU3UfU�U�U���3�f��������3�f��������3�fՙ������3�f{��a����q�4��w����k����[�������ѻ�������럿� �<�� !lQ@;
How do I get the image to show up correctly? (eventually, I want to place the image within a table cell)