ARTICLE DETAIL

资讯详情

深耕网站建设、视觉设计与SEO优化的一线实战洞察。

WPF 关闭程序 Aforge摄像头关闭不了 问题

WPF 关闭程序 Aforge摄像头关闭不了 问题
public static Bitmap StaticBitmap = new Bitmap(100,100);

public void Cam_NewFrame(object sender, NewFrameEventArgs eventArgs){lock (StaticHelper.StaticBitmap){using (Bitmap b = (Bitmap)eventArgs.Frame){StaticHelper.StaticBitmap = (Bitmap)b.Clone();}}}private void timer1_Tick(object sender, EventArgs e){lock (StaticHelper.StaticBitmap){pictureBox1.Image = (Bitmap)StaticHelper.StaticBitmap.Clone();}}
返回列表