コード例 #1
0
 public void BuildDiametr(int fromAngle, int toAngle, bool shouldNodmalise)
 {
     if (storage.selectedAreaOfImage != null)
     {
         var diametr = calculateParams.GetDiametr(fromAngle,
                                                  toAngle,
                                                  storage.AllDiametrs,
                                                  shouldNodmalise);
         storage.CurrentDiametrsGraphic = diametr;
         formWindow.ShowDiametrGraphics(diametr);
     }
     else
     {
         if (storage.selectedAreaOfImage == null)
         {
             erroreMessage = "You don`t load image";
         }
         formWindow.ShowMessage(erroreMessage);
     }
 }
コード例 #2
0
        public string PreparationSelectedImage()
        {
            string statusAction = "OK";


            if (storage.selectedAreaOfImage != null)
            {
                storage.selectedAreaOfImage.brightness           = calculateParams.GetBrightness(storage.selectedAreaOfImage.selectedArea);
                storage.selectedAreaOfImage.normalizedBrightness = calculateParams.Normalization(storage.selectedAreaOfImage.brightness,
                                                                                                 storage.selectedAreaOfImage.selectedArea.Width,
                                                                                                 storage.selectedAreaOfImage.selectedArea.Height);
                storage.selectedAreaOfImage.borderImageFigureCoordinat = calculateParams.FindeBorderCoordinats(storage.selectedAreaOfImage.brightness,
                                                                                                               storage.selectedAreaOfImage.selectedArea.Width,
                                                                                                               storage.selectedAreaOfImage.selectedArea.Height);
                storage.selectedAreaOfImage.middlePointOfArea = calculateParams.MiddlePointOfArea;

                var allDiametr = calculateParams.GetDiametr(0,
                                                            360,
                                                            storage.selectedAreaOfImage.borderImageFigureCoordinat,
                                                            storage.selectedAreaOfImage.loadedImage,
                                                            storage.selectedAreaOfImage.middlePointOfArea,
                                                            false);

                storage.AllDiametrs  = allDiametr;
                storage.MaxIntensity = calculateParams.MaxIntensity;
                storage.MaxDiametr   = calculateParams.MaxDiametr;
                storage.MaxAngle     = calculateParams.MaxAngle;



                writer.WriteBrightnessToFile(storage.selectedAreaOfImage.brightness,
                                             storage.selectedAreaOfImage.selectedArea.Width,
                                             storage.selectedAreaOfImage.selectedArea.Height);
            }
            else
            {
                statusAction  = "Errore";
                erroreMessage = "You dont select any picture";
                formWindow.ShowMessage(erroreMessage);
            }



            //  writer.wr(storage.selectedAreaOfImage.borderImageFigureCoordinat);


            return(statusAction);
        }