如何绘制带边框的箭头?

发布于 2024-10-04 14:06:23 字数 1028 浏览 1 评论 0原文

我正在尝试绘制一个有边框或轮廓的箭头。我将此箭头绘制为第三方程序中的叠加层。这是该代码的简化示例。

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:

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

酒与心事 2024-10-11 14:06:23

最终,我完全重新设计和重构了原始代码。我最终做的是根据原始箭头的比例绘制一个较小的箭头。

最后我发现,我什么也没做,我只是使用了不同的方法。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文