//-------------------------------------------------------------------------------------- private void tsbByAllColorvsDistance_Click(object sender, EventArgs e) { try { Bitmap lInBmp = pbSource.Image as Bitmap; if (lInBmp == null) { MessageBox.Show("Нет картинки"); return; } Bitmap lBmp = fBlackWhiteExplorer.PictureToBlackWhiteByDistance(lInBmp); pbBlackWhite.Image = lBmp; } catch (Exception ee) { MessageBox.Show(ee.ToString()); } }