在VB.NET中绘制,绘制线条和橡皮擦 [英] Paint in VB.NET, Draw Lines and eraser

查看:129
本文介绍了在VB.NET中绘制,绘制线条和橡皮擦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果单击按钮,如何在图片框中绘制线条?

How to draw lines in a picturebox if a button is clicked?

推荐答案

http://www.dreamincode.net/forums/topic/117255-drawing -on-a-picturebox-control/ [
http://www.xtremedotnettalk.com/showthread.php?t=74517[^]
http://www.dreamincode.net/forums/topic/117255-drawing-on-a-picturebox-control/[^]


您似乎正在尝试滥用PictureBox.即使可以,也没有任何情况需要使用它.如果需要绘制位图,则可以直接进行绘制.如果您需要使用某些UI控件,PictureBox根本不会帮您.它只会创建和附加级别的间接,没有任何回报.这只会占用您的开发时间和一些额外的资源,包括CPU时间.

该怎么做呢?这很简单.请查看我过去的答案:
如何从旧图纸中清除面板 [ ^ ],
在C#中绘制矩形 [在图片框内添加图片 [在mdi子表单之间画线 [ Paint是一种哪种好玩的方法? (DataGridViewImageCell.Paint(...)) [在面板上捕获图形 [
It looks like you are trying to abuse PictureBox. There are no situations where you need to draw on it, even though you can. If you need to draw in a bitmap, you can do it directly. If you need to draw on some UI control, PictureBox won''t help you at all; it would only create and additional level of indirection, giving nothing in return. It would only eat up your development time and some extra resources, including CPU time.

What to do instead? This is easy. Please see my past answers:
How do I clear a panel from old drawing[^],
draw a rectangle in C#[^],
Append a picture within picturebox[^].

Please also see these related answers:
Drawing Lines between mdi child forms[^],
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[^],
capture the drawing on a panel[^].

—SA


这篇关于在VB.NET中绘制,绘制线条和橡皮擦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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