T
Tony Johansson
Here I draw the y axes with 1 pixel wide this works fine.
Now I want to keep the width of the line with one pixel but I want an arrow
at the top.
If I now draw the arrow by using this code
pen.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
the arrow is too small so how do I draw a bigger arrow but keep the same
width of the y axes ?
private void pnlDiagram_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
//Move origo down to the left corner
g.TranslateTransform(pnlDiagram.Width * 1/10, pnlDiagram.Height *
9/10);
Pen pen = new Pen(Color.Blue, 1);
pen.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
Point yaxelStart = new Point(0, 0);
Point yaxelSlut = new Point(0, -pnlDiagram.Height +
(int)(2*0.1*pnlDiagram.Height));
g.DrawLine(pen, yaxelStart, yaxelSlut);
}
//Tony
Now I want to keep the width of the line with one pixel but I want an arrow
at the top.
If I now draw the arrow by using this code
pen.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
the arrow is too small so how do I draw a bigger arrow but keep the same
width of the y axes ?
private void pnlDiagram_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
//Move origo down to the left corner
g.TranslateTransform(pnlDiagram.Width * 1/10, pnlDiagram.Height *
9/10);
Pen pen = new Pen(Color.Blue, 1);
pen.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
Point yaxelStart = new Point(0, 0);
Point yaxelSlut = new Point(0, -pnlDiagram.Height +
(int)(2*0.1*pnlDiagram.Height));
g.DrawLine(pen, yaxelStart, yaxelSlut);
}
//Tony