private void Worker_DoWork(object sender, DoWorkEventArgs e) { var response = ImageComponent.IdentifyDartMembers(_image.ImageToByteArray()); _image = null; pbSave.Invoke(new MethodInvoker( delegate() { pbSave.Image = response; })); pbLoading.Invoke(new MethodInvoker( delegate() { pbLoading.Visible = false; })); pbSearch.Invoke(new MethodInvoker( delegate() { pbSearch.Visible = true; })); }