private void showImage() { if (imgBox.InvokeRequired) { // instantiate delegate to access picture box in thread ShowImageDelegate sid = new ShowImageDelegate(showImage); this.Invoke(sid); } else { imgBox.BackgroundImage = frame.Bitmap; // update BackgroundImage of picturebox } }
public Form1() { InitializeComponent(); handler = ShowImageInvoke; }