如何在图片框上画线(多行),在缩放时保持相同的宽度? [英] How to drawline (Multiple lines) on picturebox which keeps same width when zoomed?

查看:163
本文介绍了如何在图片框上画线(多行),在缩放时保持相同的宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我绘制多行(最多1000+)时,我想放大但保持线条宽度相同而不是缩放比例。目前我正在绘制图像(Bitmap)。放大时使线条变胖或缩小使线条变薄。我也试过图形绘制,这会导致很多平移和缩放图像丢失的问题。



我的技能水平很低所以请尽量保持简单。 />


提前谢谢。

When I draw a multiple line (up to 1000+) I would like to zoom in but keep the line the same width & not at the zoomed scale. At the moment I am drawing to image (Bitmap). Which when zoomed in makes the line fat or zoomed out makes the line thin. I also tried graphics draw which caused a lot of issues with panning & zooming with image loss.

My skill level is low so please try to keep it simple.

In advance thanks.

推荐答案

这里的关键是不要使用 PictureBox 。你可以,但它不会帮助你,只会增加麻烦,让你浪费你的开发时间和一些额外的系统资源。它完全没有意义,只有一些伤害。它只适用于最简单的静态物品。



我会告诉你该怎么做。请查看我过去的答案:

在其中附加图片图片框 [ ^ ],

画一个矩形C# [ ^ ],

如何从旧图纸中清除面板 [ ^ ]。



有关详细信息,请参阅这些答案。图形渲染:

什么样的俏皮方法是Paint? (DataGridViewImageCell.Paint(...)) [ ^ ],

在面板上捕获绘图 [ ^ ],

mdi子表单之间的绘制线 [ ^ ],

如何加快我的vb.net应用程序? [ ^ ],

用C#.net鼠标滚轮缩放图像 [ ^ ]。



请注意,这些答案中的最后一个侧重于缩放实现。



这就是全部。还有其他问题吗?



-SA
The key here is not to use PictureBox. You could, but it won't help you, will only add hassles and make you waste your development time and some extra system resources. It makes no sense at all, only some harm. It is only good for simplest static things.

I'll tell you what to do instead. Please see my past answers:
Append a picture within picturebox[^],
draw a rectangle in C#[^],
How do I clear a panel from old drawing[^].

See also these answers on further detail on graphics rendering:
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[^],
capture the drawing on a panel[^],
Drawing Lines between mdi child forms[^],
How to speed up my vb.net application?[^],
Zoom image in C# .net mouse wheel[^].

Note that the last of these answers is focused on zoom implementation.

That's all. Any further questions?

—SA


这篇关于如何在图片框上画线(多行),在缩放时保持相同的宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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