如何使用C#绘制/绘制失败的箭头 [英] How to draw/sketch an failed arrow using C#

查看:58
本文介绍了如何使用C#绘制/绘制失败的箭头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows窗体。

我有一个绘制箭头的现有代码。现在我需要一个带X的新箭头(代表失败的箭头)。感谢任何帮助。



我尝试过:



double xAxis = arrow.StartCoordinate.x;

double yAxis = arrow.StartCoordinate.y;

double xeAxis = arrow.EndCoordinate.x;

double yeAxis = arrow.EndCoordinate.y;

double lineCentre = arrowLine.BBox.AsRectangleF.Width / 8;

Point3d point1 = new Point3d(xAxis +(lineCentre + lineCentre) ),yAxis + lineCentre);

Point3d point2 = new Point3d(xeAxis - (lineCentre + lineCentre),yeAxis - lineCentre);

Point3d point3 = new Point3d(xAxis + (lineCentre + lineCentre),yAxis - lineCentre);

Point3d point4 = new Point3d(xeAxis - (lineCentre + lineCentre),yeAxis + lineCentre);

Windows form.
i have a existing code that draw's arrow. now i need to have a new arrow with X (which represents failed arrow). Any help is appreciated.

What I have tried:

double xAxis = arrow.StartCoordinate.x;
double yAxis = arrow.StartCoordinate.y;
double xeAxis = arrow.EndCoordinate.x;
double yeAxis = arrow.EndCoordinate.y;
double lineCentre = arrowLine.BBox.AsRectangleF.Width/8;
Point3d point1 = new Point3d(xAxis + ( lineCentre + lineCentre ), yAxis + lineCentre );
Point3d point2 = new Point3d(xeAxis - (lineCentre + lineCentre ), yeAxis - lineCentre);
Point3d point3 = new Point3d(xAxis + (lineCentre + lineCentre ), yAxis - lineCentre);
Point3d point4 = new Point3d(xeAxis - ( lineCentre + lineCentre ), yeAxis + lineCentre);

推荐答案

假设BBox描述了箭头被绘制的框的边界区域,X是微不足道的:从左上角到右下角绘制一条线,从右上角到底部绘制一条线 - 剩下。



但你展示的代码什么都没有...
Assuming that BBox describes the bounding area of the box the arrow is drawn into, an "X" is trivial: draw a line from Top-Left to Bottom-Right, and a second from Top-Right to Bottom-Left.

But that code you show draws nothing ...


这篇关于如何使用C#绘制/绘制失败的箭头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆