in nowdays we see a lot of this..for example i have myAsp.aspx and when i open it instead of html i get an image...this is due that contentType propriety has "image/jpeg"..but..what do i have to do in asp.net so i can make the same effect? i tryed this : (it's in C# but u should have no troubles understanding it):
if anyone has another example in C# or VB.NET could give it to me plz?PHP Code:public class WebForm1 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
Bitmap image = new Bitmap(100, 100, PixelFormat.DontCare);
Graphics g = Graphics.FromImage(image);
g.DrawRectangle(new Pen(new SolidBrush(Color.Red)), 0, 0, 50, 50);
ImageCodecInfo[] imgCodecs = ImageCodecInfo.GetImageEncoders();
EncoderParameters imgParams = new EncoderParameters(1);
image.Save(Response.OutputStream, imgCodecs[1], imgParams);
// Put user code to initialize the page here
}




Reply With Quote