如何绘制带边框的箭头?
我正在尝试绘制一个有边框或轮廓的箭头。我将此箭头绘制为第三方程序中的叠加层。这是该代码的简化示例。
private void DrawWindArrow(Graphics Screen, int screenWidth, int screenHeight)
{
Trace.WriteLine("Entering...DrawWindArrow");
NArrow.FontSize = 10;
NArrow.CenterText = 20;
NArrow.Scale = GetScale(NArrow.Size);
NArrow.Scale += 0.2f;
NArrow.CalculateArrowSize(NArrow.Scale);
NArrow.FontSize = ChangeFontSize(NArrow.Size);
NArrow.CoordinateX = GetXCoordinates(NArrow.Position, screenWidth);
NArrow.CoordinateY = GetYCoordinates(NArrow.Position, screenHeight);
NArrow.CenterText = CenterText(NArrow.Size, NArrow.CoordinateX);
NArrow.CalculateArrowProperties();
NArrow.CenterOfArrowy = NArrow.CenterOfArrow + NArrow.CoordinateY;
NArrow.CenterOfArrow += NArrow.CoordinateX;
}
}
这是我正在寻找的箭头的示例:
I am attempting to draw an arrow which has a border or a outline. I am drawing this arrow as an overlay within a third-party program. Here is a simplified example of that code.
private void DrawWindArrow(Graphics Screen, int screenWidth, int screenHeight)
{
Trace.WriteLine("Entering...DrawWindArrow");
NArrow.FontSize = 10;
NArrow.CenterText = 20;
NArrow.Scale = GetScale(NArrow.Size);
NArrow.Scale += 0.2f;
NArrow.CalculateArrowSize(NArrow.Scale);
NArrow.FontSize = ChangeFontSize(NArrow.Size);
NArrow.CoordinateX = GetXCoordinates(NArrow.Position, screenWidth);
NArrow.CoordinateY = GetYCoordinates(NArrow.Position, screenHeight);
NArrow.CenterText = CenterText(NArrow.Size, NArrow.CoordinateX);
NArrow.CalculateArrowProperties();
NArrow.CenterOfArrowy = NArrow.CenterOfArrow + NArrow.CoordinateY;
NArrow.CenterOfArrow += NArrow.CoordinateX;
}
}
Here is an example of the arrow I am looking for:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最终,我完全重新设计和重构了原始代码。我最终做的是根据原始箭头的比例绘制一个较小的箭头。
最后我发现,我什么也没做,我只是使用了不同的方法。
At the end of the day I ended up redesigning and refactoring the orignal code in its entirely. What I ended up doing was drawing a smaller arrow based on a ratio of the original arrow.
In the end I was able to figure out, there wasn't a single thing I did, I simply used a different approach.