有人有闪电符号的C#代码片段吗? [英] Does somebody have a C# code snippet for a lightning bolt symbol ?

查看:89
本文介绍了有人有闪电符号的C#代码片段吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Everyone,



我正在寻找用于绘制闪电符号的小片段c#代码。

给你一个想法,我正在寻找产生这种形象的代码:闪电。 />


即使是未填充的闪电符号也会很棒。



非常感谢您提前。< br $> b $ b

祝你好运。

MiQi



我尝试过什么:



我创建了一个图像(png)但是当我在图片框顶部绘制时,形状调整大小并不是很好。 />


使用drawline,...会产生更好的结果。

Hello Everyone,

I am looking for the small snippet c# code to draw a lightning bolt symbol.
To give you an idea, I am looking for the code the generate this kind of image: lightning bolt.

Even a non filled in lightning bolt symbol would be great.

Thank you very much in advance.

Best regards.
MiQi

What I have tried:

I have created an image (png) but the shape resize is not really nice when I draw it on top of the picture box.

Using drawline, ... would produce a better result.

推荐答案

严重吗?你想让别人为你生成7分的坐标吗?



怎么样?你生成它们。这很简单。



拿一张纸,一支铅笔和一把尺子。在纸上画出闪电形状。测量形状的宽度。左上角是0,0。右上角将是0,1。对于它们之间的任何点,它们将是1的百分比。如果你需要的点在0和1之间,那么在形状顶部的那个点将是0,0.5。



高度相同。在最左边的形状的一半,将是0.5,0。



但是,我听到你问为什么0和1之间的值? 这是因为您可以将图像缩放到任何大小,只需将您想要的图像的宽度和高度乘以您为每个点生成的值即可获得缩放点。
Seriously? You want someone to generate coordinates for 7 points for you?

How about this. You generate them. It's easy.

Grab a piece of paper, a pencil, and a ruler. Draw your lightning shape on the paper. Measure the width of the shape. The top left is going to be 0,0. The top right is going to be 0,1. For any points between, they are going to be a percentage of 1. If the point you need is half way between 0 and 1, that point, at the top of the shape, is going to be 0,0.5.

Do the same for the height. Half way down the shape, on the far left edge, is going to be 0.5,0.

But, I hear you asking "why values betwen 0 and 1?" That's because you can scale your image to any size just by multiplying the width and height of the image you want by the values you generated for each point to get the scaled point.


这篇关于有人有闪电符号的C#代码片段吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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