PictureBox与其他方法的PaintEvent在我的表单中只有一个图片框,我想用这个图片框上的方法绘制圆圈,但我不能这样做而不工作。方法是: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贡献1829条经验 获得超7个赞
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 关注
- 514 浏览
添加回答
举报
0/150
提交
取消