PictureBox PaintEvent与其他方法我的表单中只有一个PictureBox,我想在这个PictureBox上画一个方法,但是我不能这样做,不能工作。方法是:private Bitmap Circle()
{
Bitmap bmp;
Graphics gfx;
SolidBrush firca_dis=new SolidBrush(Color.FromArgb(192,0,192));
bmp = new Bitmap(40, 40);
gfx = Graphics.FromImage(bmp);
gfx.FillRectangle(firca_dis, 0, 0, 40, 40);
return bmp;
}图片盒 private void pictureBox2_Paint(object sender, PaintEventArgs e)
{
Graphics gfx= Graphics.FromImage(Circle());
gfx=e.Graphics;
}
2 回答
冉冉说
TA贡献1877条经验 获得超1个赞
private static void DrawCircle(Graphics gfx){ SolidBrush firca_dis = new SolidBrush(Color.FromArgb(192, 0, 192)); Rectangle rec = new Rectangle(0, 0, 40, 40); //Size and location of the Circle gfx.FillEllipse(firca_dis, rec); //Draw a Circle and fill it gfx.DrawEllipse(new Pen(firca_dis), rec); //draw a the border of the cicle your choice}
- 2 回答
- 0 关注
- 485 浏览
添加回答
举报
0/150
提交
取消