如何在picturebox前面出现线条? [英] How to make lines appear in front of picturebox?

查看:106
本文介绍了如何在picturebox前面出现线条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

展开 | 选择 | Wrap | 行号

推荐答案

不使用创建新图形对象,而是使用参数附带的图形对象。你过去的OnPaint方法。它在PaintEventArgs参数中作为名为Graphics的属性。


然后您可以更新drawRobot方法以获取Graphics参数。

Instead of creating a new graphics object, use the one that comes with the parameter of the OnPaint method you over rode. It''s in the PaintEventArgs parameter as a property named Graphics.

Then you can update your drawRobot method to take a Graphics parameter.

展开 | 选择 | Wrap | 行号


我把这些命令放入,但机器人仍然在.jpg后面。我不知道为什么这是

谢谢
Hi, I put those commands in, but the robot is still drawn behind the .jpg. I don''t know why this is
thanks


正如我所提到的,你正在使用表格。所以你的PictureBox很可能会超过顶部。而不是使用Form'的paint事件,使用PictureBox本身上的那个。应该有一个可以使用的OnPaint事件。
As I mentioned, you''re currently drawing on the form. So it''s quite likely that your PictureBox will draw over top. Instead of using the Form''s paint event, use the one on the PictureBox itself. There should be an OnPaint event you can use.


这篇关于如何在picturebox前面出现线条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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