c# 在 PictureBox 上绘制图像、文字与放置button的方法

在PictureBox 上绘制图像、文字是在背景图像上绘制,使用:

Graphics g1=new Graphics.FromImage(pictureBox1.BackgroundImage);

而在PictureBox 上放置button则使用

Button btn =new Button();
btn.xxx=xxx;
btn.Location=pointx;
pictureBoxX.Contrls.Add(btn);

两者有所区别,绘制图像、文字是在底层图像上,而Button则浮在PictureBox表面。

猜你喜欢

转载自blog.csdn.net/weixin_39235487/article/details/80223555