ImageList的用法
privatevoidForm1_Click(objectsender,EventArgse){System.Drawing.Graphicsg=this.CreateG...
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组件的图像? 展开
1个回答
展开全部
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)实现代码里画。
{
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)实现代码里画。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询