예제 #1
0
 //--------------------------------------------------------------------------------------
 private void CreateBlackWhiteForRed()
 {
     try
     {
         CDescriptionPartition lDescriptionPartition = null;
         Image bmpBW = fBlackWhiteExplorer.PictureToBlackWhiteVarBorder(fSourceBitmap, 1, tbRed.Value, out lDescriptionPartition);
         pbRed.Image = bmpBW;
         txtAverageBottomRed.Text  = Math.Round(lDescriptionPartition.AverageBottom).ToString();
         txtAverageTopRed.Text     = Math.Round(lDescriptionPartition.AverageTop).ToString();
         txtBottomWeightRed.Text   = lDescriptionPartition.BottomWeight.ToString();
         txtTopWeightRed.Text      = lDescriptionPartition.TopWeight.ToString();
         txtBottomDevisionRed.Text = Math.Round(lDescriptionPartition.BottomDevision).ToString();
         txtTopDevisionRed.Text    = Math.Round(lDescriptionPartition.TopDevision).ToString();
         txtBottomEstRed.Text      = Math.Round(lDescriptionPartition.BottomDevision + lDescriptionPartition.TopDevision).ToString();
     }
     catch (Exception ee)
     {
         MessageBox.Show(ee.ToString());
     }
 }
예제 #2
0
 //--------------------------------------------------------------------------------------
 private void Exec()
 {
     try
     {
         CDescriptionPartition lDescriptionPartition = null;
         Image bmpBW = fBlackWhiteExplorer.PictureToBlackWhiteVarBorder(fImage, cbColor.SelectedIndex + 1, int.Parse(txtBorder.Text), out lDescriptionPartition);
         pbTarget.Image         = bmpBW;
         txtAverageBottom.Text  = Math.Round(lDescriptionPartition.AverageBottom).ToString();
         txtAverageTop.Text     = Math.Round(lDescriptionPartition.AverageTop).ToString();
         txtBottomWeight.Text   = lDescriptionPartition.BottomWeight.ToString();
         txtTopWeight.Text      = lDescriptionPartition.TopWeight.ToString();
         txtBottomDevision.Text = Math.Round(lDescriptionPartition.BottomDevision).ToString();
         txtTopDevision.Text    = Math.Round(lDescriptionPartition.TopDevision).ToString();
     }
     catch (Exception ee)
     {
         MessageBox.Show(ee.ToString());
     }
 }