110,538
社区成员
发帖
与我相关
我的任务
分享
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
//画图片
Image image = new Bitmap("d:\\Test\\320x240.bmp");
int width = image.Width;
int height = image.Height;
e.Graphics.DrawImage(
image,
new Rectangle(0, 0, width, height),
0,
0,
width,
height,
GraphicsUnit.Pixel,
null);
//在图片上画一条白色斜线(可能是其他颜色线条)
int x1 = 109;
int y1 = 94;
int x2 = 163;
int y2 = 134;
e.Graphics.DrawLine(new Pen(Color.White, 1),
x1,
y1,
x2,
y2);
}