private void Form1_Paint(object sender, PaintEventArgs e)
        {
            Image newimage = imageList1.Images[0];
            Point point1 = new Point(label1.Location.X - 2, label1.Location.Y + 10);
            Point point2 = new Point(label1.Location.X - 2, label1.Location.Y + 15);
            Point point3 = new Point(label1.Location.X + 16, label1.Location.Y + 10);
            Point[] a = new Point[3] { point1, point2, point3 };
            e.Graphics.DrawImage(newimage, a);
        }
拖了一个label到窗口我在label上画一幅图,这幅图是imageList中存的一幅图,请问,怎么没有画成功,是啥原因?MSDN:
http://msdn.microsoft.com/zh-cn/library/4f9s3at1.aspx

解决方案 »

  1.   

    是你的位置不对
    我试过这样能画出来 Graphics graphics = e.Graphics;
                Image newImage = Image.FromFile(@"C:\Documents and Settings\hao\My Documents\My Pictures\beauty1.jpg");
                Point ulCorner = new Point(100, 100);
                Point urCorner = new Point(550, 100);
                Point llCorner = new Point(150, 250);
                Point[] destPara = { ulCorner, urCorner, llCorner };
                graphics.DrawImage(newImage, destPara);