日期:2014-05-17 浏览次数:20848 次
KeyDown += (ss, ee) =>
{
if (ee.KeyCode == Keys.C)
{
MessageBox.Show(ee.KeyValue + "");
}
};
public void refreshImg(Image image)
{
Bitmap bufferBmp = (Bitmap)image;//new Bitmap(200, 200); //创建位图缓冲区
Graphics g = this.panel1.CreateGraphics(); //创建窗体图形
Pen pen = new Pen(Color.Red);
Graphics buf_g = Graphics.FromImage(bufferBmp);
buf_g.Dispose(); //绘画已完成,释放掉buf_g
g.DrawImage(bufferBmp, 0, 0); //将bufferBmp中的内容画到屏幕上
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.A)
{
Image img = null;
refreshImg(img);
}
}