永发信息网

C# 坐标系箭头

答案:3  悬赏:40  手机版
解决时间 2021-02-11 02:50
  • 提问者网友:锁深秋
  • 2021-02-10 22:23
GDI+ 中p.EndCap = LineCap.ArrowAnchor;//定义线尾的样式为箭头
箭头画笔宽度够大才能看得清,怎么样才能画出的线细而且箭头足够大?可不可以定义箭头大小?
最佳答案
  • 五星知识达人网友:一秋
  • 2021-02-10 23:58
bitmap bit = new bitmap(picturebox1.width, picturebox1.height);
graphics g = graphics.fromimage(bit);
pen pen = new pen(color.red);
g.drawline(pen, 10, 20, 10, picturebox1.height - 10); // (10,20)y轴的上端的点坐标( 10, picturebox1.height - 10 ) y轴下端点的坐标
// (10, picturebox1.height - 10)x轴的左端的点坐标( picturebox1.width-10 , picturebox1.height - 10 )x轴右端点的坐标
g.drawline(pen, 10, picturebox1.height - 10,picturebox1.width-10 , picturebox1.height - 10);

picturebox1.image=bit;
bit.dispose();
g.dispose();

箭头:
pen 。startcap = system.drawing.drawing2d.linecap.roundanchor
pen 。endcap = system.drawing.drawing2d.linecap.arrowanchor;
全部回答
  • 1楼网友:思契十里
  • 2021-02-11 02:45
System.Drawing.Drawing2D.AdjustableArrowCap lineCap = new System.Drawing.Drawing2D.AdjustableArrowCap(6, 6, true); Pen redArrowPen = new Pen(Color.Red, 4); redArrowPen.CustomEndCap = lineCap; e.Graphics.DrawLine(redArrowPen, 25, 5, 25, 100); 你试试看,是不是要这样的
  • 2楼网友:詩光轨車
  • 2021-02-11 01:12
请使用如下代码: System.Drawing.Drawing2D.AdjustableArrowCap lineCap = new System.Drawing.Drawing2D.AdjustableArrowCap(6, 6, true); Pen redArrowPen = new Pen(Color.Red, 4); redArrowPen.CustomEndCap = lineCap; e.Graphics.DrawLine(redArrowPen, 25, 5, 25, 100);
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯