ImageList的用法
来源:百度知道 编辑:UC知道 时间:2024/05/30 06:49:45
private void Form1_Click(object sender, EventArgs e)
{
System.Drawing.Graphics g = this.CreateGraphics();
Pen p1=new Pen(Color.Red,2);
g.DrawLine(p1, 2, 3, 10, 29);
imageList1.Draw(g, 50, 50, 20, 20, 1);
}
为什么不能画出imagelist组件的图像?
{
System.Drawing.Graphics g = this.CreateGraphics();
Pen p1=new Pen(Color.Red,2);
g.DrawLine(p1, 2, 3, 10, 29);
imageList1.Draw(g, 50, 50, 20, 20, 1);
}
为什么不能画出imagelist组件的图像?
private void Form1_Click(object sender, EventArgs e)
{
System.Drawing.Graphics g = this.CreateGraphics();
imageList1.Draw(g, 50, 50, 20, 20, 1);
Pen p1=new Pen(Color.Red,2);
g.DrawLine(p1, 2, 3, 10, 29);
}
最好重载protected override void OnDrawItem(System.Windows.Forms.DrawItemEventArgs e)实现代码里画。