Hi,
I´m just trying to draw a simple triangle with a border.
In this case a 2px red border.
Is there any better way to do this?

In web apps, we can´t use the OnPaint event. So I suppose we can´t use the GraphicsPath object??

It would be nice, to draw the border and fill in the object.

But instead at least here I drew the border, and then did a fill of an area, defined by points.

Well any suggestions on how to improve this?

Also is there some kind of ofset property for the graphics object, that will let me paint inside the object without having to take into account the borders myself?

Code:
protected void Page_Load(object sender, EventArgs e)
    {
     
        Bitmap bp = new Bitmap(400,400);

        Graphics grp = Graphics.FromImage(bp);
        Rectangle rect = new Rectangle(0, 0, bp.Width, bp.Height);
        Pen pn = new Pen(Brushes.Red, 2);
        grp.SmoothingMode = SmoothingMode.AntiAlias;
        grp.Clear(Color.White);
        grp.DrawLine(pn, rect.Width / 2, 0, rect.Width - 2, rect.Height - 2);
        grp.DrawLine(pn, rect.Width - 2, rect.Height - 2, 0 + 2, rect.Height - 2);
        grp.DrawLine(pn, 0 + 2, rect.Height - 2, rect.Width / 2, 0);


        Point[] MyPointArray = new Point[4];
        MyPointArray[0] = new Point(rect.Width/2,2);
        MyPointArray[1]  = new Point(rect.Width - 3,rect.Height - 3);
        MyPointArray[2]  = new Point(0 + 3,rect.Height - 3);
        MyPointArray[3] = new Point(rect.Width / 2, 2);
        grp.FillPolygon(Brushes.Blue, MyPointArray);
        Response.Clear();
        bp.Save(Response.OutputStream,System.Drawing.Imaging.ImageFormat.Gif);
    }