private void UpdateImage()
        {
            imgToShow = origImage.Copy();
            if (!sunDiskPositionAndSize.IsNull)
            {
                int thickness = 0; // fill out
                switch (currMouseActionRegime)
                {
                case MouseActionsRegime.Nothing:
                    thickness = 0;
                    break;

                case MouseActionsRegime.DrawingSunDisk:
                    thickness = 2;
                    break;

                case MouseActionsRegime.MovingSunDisk:
                    thickness = 2;
                    break;

                case MouseActionsRegime.ResizingSunDisk:
                    thickness = 2;
                    break;

                default:
                    break;
                }

                imgToShow.Draw(sunDiskPositionAndSize.CircleF(), new Bgr(Color.Orange), thickness);
            }

            ThreadSafeOperations.UpdatePictureBox(pbTheImage, imgToShow.Bitmap, true);
            ThreadSafeOperations.SetText(lblTitle, sunDiskPositionAndSize.ToString(), false);
        }
 private void SunDiskRepresentingAndCorrectionForm_Paint(object sender, PaintEventArgs e)
 {
     if (imgToShow == null)
     {
         imgToShow = origImage.Copy();
     }
     ThreadSafeOperations.UpdatePictureBox(pbTheImage, imgToShow.Bitmap, true);
 }
Exemplo n.º 3
0
 private void SimpleShowImageForm_Paint(object sender, PaintEventArgs e)
 {
     if (LocalBitmap2show != null)
     {
         ThreadSafeOperations.UpdatePictureBox(pb1, LocalBitmap2show, true);
     }
     ThreadSafeOperations.SetText(lblTitle1, title, false);
     this.Text = title;
 }
        private void DataDistributionRepresentingForm_Paint(object sender, PaintEventArgs e)
        {
            if (contextHasBeenChanged)
            {
                constructdataRepresentingPicture();
                contextHasBeenChanged = false;
            }

            ThreadSafeOperations.UpdatePictureBox(pbRes, representingImage.Bitmap, true);
        }
        private void simpleMultipleImagesShow_Paint(object sender, PaintEventArgs e)
        {
            for (int i = 0; i < 6; i++)
            {
                ThreadSafeOperations.UpdatePictureBox((PictureBox)(Controls.Find("pb" + (i + 1).ToString(), true)[0]),
                                                      bmList[i], true);

                ThreadSafeOperations.SetText((Label)(Controls.Find("lblTitle" + (i + 1).ToString(), true)[0]), titlesList[i],
                                             false);
            }
        }
        private void pbHistRepresentation_Click(object sender, EventArgs e)
        {
            //xCoordinateBinCenter = Convert.ToInt32(serviceSpaceGap + (binCenter - xSpaceMin) * koeffX);
            //yCoordinateTop = Convert.ToInt32(pictureHeight - serviceSpaceGap - probDens * koeffY);

            // currBinCenter = ((xCoordinate - serviceSpaceGap)/koeffX) + xSpaceMin
            // currProbDens = (pictureHeight - serviceSpaceGap - yCoordinateTop)/koeffY

            int    mouseClickX   = ((MouseEventArgs)e).X;
            int    mouseClickY   = ((MouseEventArgs)e).Y;
            double currBinCenter = ((mouseClickX - serviceSpaceGap) / koeffX) + xSpaceMin;
            //double currProbDens = (pictureHeight - serviceSpaceGap - mouseClickY)/koeffY;

            int barWidthHalfed = Convert.ToInt32((double)barWidth / 2.0d);

            barWidthHalfed = (barWidthHalfed < 1) ? (1) : (barWidthHalfed);

            for (int i = 0; i < histToRepresent.BinsCount; i++)
            {
                double binCenter            = histToRepresent.dvbinsCenters[i];
                double probDens             = histToRepresent.dvProbDens[i];
                int    xCoordinateBinCenter = Convert.ToInt32(serviceSpaceGap + (binCenter - xSpaceMin) * koeffX);
                if ((mouseClickX >= xCoordinateBinCenter - barWidthHalfed) &&
                    (mouseClickX <= xCoordinateBinCenter + barWidthHalfed))
                {
                    int yCoordinateTop = Convert.ToInt32(pictureHeight - serviceSpaceGap - probDens * koeffY);
                    yCoordinateTop = (yCoordinateTop == pictureHeight - serviceSpaceGap)
                        ? (pictureHeight - serviceSpaceGap - 2)
                        : (yCoordinateTop);
                    Point             ptUperLeft = new Point(xCoordinateBinCenter - barWidthHalfed, yCoordinateTop);
                    Size              barSize    = new Size(barWidth, pictureHeight - serviceSpaceGap - yCoordinateTop);
                    Image <Bgr, byte> tmpImage   = theImage.Copy();
                    tmpImage.Draw(new Rectangle(ptUperLeft, barSize), colorMagenta, -1);
                    theFont.thickness = 2;
                    tmpImage.Draw(binCenter.ToString("e"), ref theFont, new Point(mouseClickX - 40, pictureHeight + 30 - serviceSpaceGap), colorBlack);
                    tmpImage.Draw((probDens).ToString("e"), ref theFont, new Point(serviceSpaceGap + 4, yCoordinateTop), colorBlack);
                    theFont.thickness = 1;
                    //tmpImage.Draw(binCenter.ToString("e"), new Point(mouseClickX - 40, pictureHeight + 30 - serviceSpaceGap), FontFace.HersheyPlain, 1.0d, colorBlack, 2);
                    //tmpImage.Draw((probDens).ToString("e"), new Point(serviceSpaceGap + 4, yCoordinateTop), FontFace.HersheyPlain, 1.0d, colorBlack, 2);
                    ThreadSafeOperations.UpdatePictureBox(pbHistRepresentation, tmpImage.Bitmap, false);
                    break;
                }
            }
        }
        private void RepresentAnalytic()
        {
            int xValuesCount = pictureWidth - (2 * serviceSpaceGap);// оставляем место на шкалу Y

            List <Point> rulerVertices = new List <Point>();

            rulerVertices.Add(new Point(serviceSpaceGap, pictureHeight - serviceSpaceGap));
            rulerVertices.Add(new Point(pictureWidth - serviceSpaceGap, pictureHeight - serviceSpaceGap));
            rulerVertices.Add(new Point(pictureWidth - serviceSpaceGap, serviceSpaceGap));
            rulerVertices.Add(new Point(serviceSpaceGap, serviceSpaceGap));
            theImage.DrawPolyline(rulerVertices.ToArray(), true, colorBlack, 2);

            DenseVector dvXSpaceValues = DenseVector.Create(xValuesCount, new Func <int, double>(i => xSpaceMin + ((double)i / ((double)xValuesCount - 1.0d)) * (xSpaceMax - xSpaceMin)));
            DenseVector parametersList = null;

            for (int i = 0; i < theRepresentingFunctions.Count; i++)
            {
                Func <DenseVector, double, double> theRepresentingFunction = theRepresentingFunctions[i];
                DenseVector currentParametersList = parameters[i];

                DenseVector dvFuncValues = DenseVector.Create(xValuesCount, new Func <int, double>(j => theRepresentingFunction(currentParametersList, dvXSpaceValues[j])));
                double      funcMax      = dvFuncValues.Max();
                double      funcMin      = dvFuncValues.Min();
                if (!ForceFuncLimits)
                {
                    overallFuncMax = (funcMax > overallFuncMax) ? (funcMax) : (overallFuncMax);
                    overallFuncMin = (funcMin < overallFuncMin) ? (funcMin) : (overallFuncMin);
                }
            }



            #region Прописываем текстовые маркеры
            MCvFont theFont = new MCvFont(Emgu.CV.CvEnum.FONT.CV_FONT_HERSHEY_PLAIN, 1.0d, 1.0d);
            theFont.thickness = 1;
            double dMarkersCount = (double)(pictureHeight - (2 * serviceSpaceGap)) / 30.0d;
            dMarkersCount = (dMarkersCount > 10.0d) ? (10.0d) : (dMarkersCount);
            double dRulerValueGap = (overallFuncMax - overallFuncMin) / (double)dMarkersCount;
            //dRulerValueGap = (dRulerValueGap < 1.0d) ? (1.0d) : dRulerValueGap;
            int    deciGap          = Convert.ToInt32(Math.Truncate(Math.Log(dRulerValueGap, 2.0d)));
            double rulerValueGap    = Math.Pow(2.0, (double)deciGap);
            double lowerMarkerValue = overallFuncMin - Math.IEEERemainder(overallFuncMin, rulerValueGap);
            lowerMarkerValue = (lowerMarkerValue < overallFuncMin) ? (lowerMarkerValue + rulerValueGap) : (lowerMarkerValue);
            double currentMarkerValue  = lowerMarkerValue;
            double nextYPositionDouble = (1.0d - ((currentMarkerValue - overallFuncMin) / (overallFuncMax - overallFuncMin))) * (double)(pictureHeight - 2 * serviceSpaceGap) + serviceSpaceGap;
            while (nextYPositionDouble > serviceSpaceGap)
            {
                double        yPositionDouble = (1.0d - ((currentMarkerValue - overallFuncMin) / (overallFuncMax - overallFuncMin))) * (double)(pictureHeight - 2 * serviceSpaceGap) + serviceSpaceGap;
                int           yPosition       = Convert.ToInt32(Math.Round(yPositionDouble));
                LineSegment2D theLine         = new LineSegment2D(new Point(serviceSpaceGap, yPosition), new Point(serviceSpaceGap - 5, yPosition));
                Bgr           markerColor     = colorBlack;
                theImage.Draw(theLine, markerColor, 2);
                String message = currentMarkerValue.ToString();
                //theImage.Draw(message, new Point(2, yPosition), Emgu.CV.CvEnum.FontFace.HersheyPlain, 1.0d, markerColor);
                theImage.Draw(message, ref theFont, new Point(2, yPosition), markerColor);
                currentMarkerValue += rulerValueGap;
                nextYPositionDouble = (1.0d - ((currentMarkerValue - overallFuncMin) / (overallFuncMax - overallFuncMin))) * (double)(pictureHeight - 2 * serviceSpaceGap) + serviceSpaceGap;
            }

            double dMarkersCountX = (double)(pictureWidth - (2 * serviceSpaceGap)) / 30.0d;
            dMarkersCountX = (dMarkersCountX > 10.0d) ? (10.0d) : (dMarkersCountX);
            double dRulerValueGapX   = (xSpaceMax - xSpaceMin) / (double)dMarkersCountX;
            int    deciGapX          = Convert.ToInt32(Math.Truncate(Math.Log(dRulerValueGapX, 2.0d)));
            double rulerValueGapX    = Math.Pow(2.0, (double)deciGapX);
            double lowerMarkerValueX = xSpaceMin - Math.IEEERemainder(xSpaceMin, rulerValueGapX);
            lowerMarkerValueX = (lowerMarkerValueX < xSpaceMin) ? (lowerMarkerValueX + rulerValueGapX) : (lowerMarkerValueX);
            double currentMarkerValueX = lowerMarkerValueX;
            double nextXPositionDouble = serviceSpaceGap + ((currentMarkerValueX - xSpaceMin) / (xSpaceMax - xSpaceMin)) * (double)(pictureWidth - 2 * serviceSpaceGap);
            while (nextXPositionDouble < pictureWidth - serviceSpaceGap)
            {
                double        xPositionDouble = serviceSpaceGap + ((currentMarkerValueX - xSpaceMin) / (xSpaceMax - xSpaceMin)) * (double)(pictureWidth - 2 * serviceSpaceGap);
                int           xPosition       = Convert.ToInt32(Math.Round(xPositionDouble));
                LineSegment2D theLine         = new LineSegment2D(new Point(xPosition, pictureHeight - serviceSpaceGap), new Point(xPosition, pictureHeight - serviceSpaceGap + 5));
                Bgr           markerColor     = colorBlack;
                theImage.Draw(theLine, markerColor, 2);
                String message = currentMarkerValueX.ToString();
                theImage.Draw(message, ref theFont, new Point(xPosition, pictureHeight - 10), markerColor);
                // theImage.Draw(message, new Point(xPosition, pictureHeight - 10), Emgu.CV.CvEnum.FontFace.HersheyPlain, 1.0d, markerColor);
                currentMarkerValueX += rulerValueGapX;
                nextXPositionDouble  = serviceSpaceGap + ((currentMarkerValueX - xSpaceMin) / (xSpaceMax - xSpaceMin)) * (double)(pictureWidth - 2 * serviceSpaceGap);
            }

            #endregion Прописываем текстовые маркеры



            double koeff = (pictureHeight - (2 * serviceSpaceGap)) / (overallFuncMax - overallFuncMin);

            for (int i = 0; i < theRepresentingFunctions.Count; i++)
            {
                Func <DenseVector, double, double> theRepresentingFunction = theRepresentingFunctions[i];
                DenseVector currentParametersList = parameters[i];

                double currFuncKoeff = koeff;
                if (scaleFunctionValuesToMax[i])
                {
                    DenseVector dvCurrFuncValues = DenseVector.Create(xValuesCount, j => theRepresentingFunction(currentParametersList, dvXSpaceValues[j]));
                    double      currFuncMax      = dvCurrFuncValues.Max();
                    double      currFuncMin      = dvCurrFuncValues.Min();

                    currFuncKoeff = (pictureHeight - (2 * serviceSpaceGap)) / (currFuncMax - currFuncMin);
                }



                //DenseVector dvXSpaceValues = DenseVector.Create(xValuesCount, new Func<int, double>(i => xSpaceMin + ((double)i / ((double)xValuesCount - 1.0d)) * (xSpaceMax - xSpaceMin)));
                parametersList = null;
                DenseVector dvFuncValues     = DenseVector.Create(xValuesCount, new Func <int, double>(j => theRepresentingFunction(currentParametersList, dvXSpaceValues[j])));
                Bgr         currentLineColor = lineColors[i];


                DenseVector xCoordinates = DenseVector.Create(xValuesCount, new Func <int, double>(j => ((double)serviceSpaceGap + j)));
                DenseVector yCoordinates = DenseVector.Create(xValuesCount, new Func <int, double>(j =>
                {
                    double pixValue = currFuncKoeff * (dvFuncValues[j] - overallFuncMin);
                    return(pictureHeight - serviceSpaceGap - pixValue);
                }));

                List <Point> funcRepresentationPoints = new List <Point>();
                for (int j = 0; j < xValuesCount; j++)
                {
                    if (double.IsNaN(yCoordinates[j]))
                    {
                        continue;
                    }
                    funcRepresentationPoints.Add(new Point(Convert.ToInt32(xCoordinates[j]), Convert.ToInt32(yCoordinates[j])));
                }
                theImage.DrawPolyline(funcRepresentationPoints.ToArray(), false, currentLineColor, 2);
            }


            ThreadSafeOperations.UpdatePictureBox(pbFunctionRepresentation, theImage.Bitmap, false);
        }
        public void Represent()
        {
            if (histToRepresent.IsEmpty())
            {
                return;
            }

            ThreadSafeOperations.SetTextTB(tbStats, "", false);

            double maxHistProbValue = histToRepresent.dvProbDens.Values.Max();
            double ySpaceGap        = 0.2d * maxHistProbValue;

            overallProbMax = maxHistProbValue + ySpaceGap;

            double maxHistValues = histToRepresent.dvData.Values.Max();
            double minHistValues = histToRepresent.dvData.Values.Min();

            double xSpaceGap = 0.2d * (maxHistValues - minHistValues);

            xSpaceMin = ((minHistValues - xSpaceGap) < xSpaceMin) ? (minHistValues - xSpaceGap) : (xSpaceMin);
            xSpaceMax = ((maxHistValues + xSpaceGap) > xSpaceMax) ? (maxHistValues + xSpaceGap) : (xSpaceMax);

            pictureWidth    = pbHistRepresentation.Width;
            pictureHeight   = pbHistRepresentation.Height;
            serviceSpaceGap = Convert.ToInt32(0.05d * Math.Min(pictureHeight, pictureWidth));
            theImage        = new Image <Bgr, Byte>(pictureWidth, pictureHeight, new Bgr(255, 255, 255));


            List <Point> rulerVertices = new List <Point>();

            rulerVertices.Add(new Point(serviceSpaceGap, pictureHeight - serviceSpaceGap));
            rulerVertices.Add(new Point(pictureWidth - serviceSpaceGap, pictureHeight - serviceSpaceGap));
            rulerVertices.Add(new Point(pictureWidth - serviceSpaceGap, serviceSpaceGap));
            rulerVertices.Add(new Point(serviceSpaceGap, serviceSpaceGap));
            theImage.DrawPolyline(rulerVertices.ToArray(), true, colorBlack, 2);

            koeffY = ((double)pictureHeight - 2.0d * (double)serviceSpaceGap) / (overallProbMax);
            koeffX = ((double)pictureWidth - 2.0d * (double)serviceSpaceGap) / (xSpaceMax - xSpaceMin);



            #region Прописываем текстовые маркеры

            double dMarkersCount = (double)(pictureHeight - (2 * serviceSpaceGap)) / 30.0d;
            dMarkersCount = (dMarkersCount > 10.0d) ? (10.0d) : (dMarkersCount);
            double dRulerValueGap      = (overallProbMax) / (double)dMarkersCount;
            int    deciGap             = Convert.ToInt32(Math.Truncate(Math.Log(dRulerValueGap, 2.0d)));
            double rulerValueGap       = Math.Pow(2.0, (double)deciGap);
            double lowerMarkerValue    = 0.0d;
            double currentMarkerValue  = lowerMarkerValue;
            double nextYPositionDouble = (1.0d - ((currentMarkerValue) / overallProbMax)) * (double)(pictureHeight - 2 * serviceSpaceGap) + serviceSpaceGap;
            while (nextYPositionDouble > serviceSpaceGap)
            {
                double        yPositionDouble = (1.0d - ((currentMarkerValue) / overallProbMax)) * (double)(pictureHeight - 2 * serviceSpaceGap) + serviceSpaceGap;
                int           yPosition       = Convert.ToInt32(Math.Round(yPositionDouble));
                LineSegment2D theLine         = new LineSegment2D(new Point(serviceSpaceGap, yPosition), new Point(serviceSpaceGap - 5, yPosition));
                Bgr           markerColor     = colorBlack;
                theImage.Draw(theLine, markerColor, 2);
                String message = Math.Round(currentMarkerValue, 2).ToString();
                theImage.Draw(message, ref theFont, new Point(2, yPosition), markerColor);
                // theImage.Draw(message, new Point(2, yPosition), FontFace.HersheyPlain, 1.0d, markerColor);
                currentMarkerValue += rulerValueGap;
                nextYPositionDouble = (1.0d - ((currentMarkerValue) / overallProbMax)) * (double)(pictureHeight - 2 * serviceSpaceGap) + serviceSpaceGap;
            }

            double dMarkersCountX = (double)(pictureWidth - (2 * serviceSpaceGap)) / 30.0d;
            dMarkersCountX = (dMarkersCountX > 10.0d) ? (10.0d) : (dMarkersCountX);
            double dRulerValueGapX   = (xSpaceMax - xSpaceMin) / (double)dMarkersCountX;
            int    deciGapX          = Convert.ToInt32(Math.Truncate(Math.Log(dRulerValueGapX, 2.0d)));
            double rulerValueGapX    = Math.Pow(2.0, (double)deciGapX);
            double lowerMarkerValueX = xSpaceMin - Math.IEEERemainder(xSpaceMin, rulerValueGapX);
            lowerMarkerValueX = (lowerMarkerValueX < xSpaceMin) ? (lowerMarkerValueX + rulerValueGapX) : (lowerMarkerValueX);
            double currentMarkerValueX = lowerMarkerValueX;
            double nextXPositionDouble = serviceSpaceGap + ((currentMarkerValueX - xSpaceMin) / (xSpaceMax - xSpaceMin)) * (double)(pictureWidth - 2 * serviceSpaceGap);
            while (nextXPositionDouble < pictureWidth - serviceSpaceGap)
            {
                double        xPositionDouble = serviceSpaceGap + ((currentMarkerValueX - xSpaceMin) / (xSpaceMax - xSpaceMin)) * (double)(pictureWidth - 2 * serviceSpaceGap);
                int           xPosition       = Convert.ToInt32(Math.Round(xPositionDouble));
                LineSegment2D theLine         = new LineSegment2D(new Point(xPosition, pictureHeight - serviceSpaceGap), new Point(xPosition, pictureHeight - serviceSpaceGap + 5));
                Bgr           markerColor     = colorBlack;
                theImage.Draw(theLine, markerColor, 2);
                String message = Math.Round(currentMarkerValueX, 2).ToString();
                theImage.Draw(message, ref theFont, new Point(xPosition, pictureHeight - 10), markerColor);
                // theImage.Draw(message, new Point(xPosition, pictureHeight - 10), FontFace.HersheyPlain, 1.0d, markerColor);
                currentMarkerValueX += rulerValueGapX;
                nextXPositionDouble  = serviceSpaceGap + ((currentMarkerValueX - xSpaceMin) / (xSpaceMax - xSpaceMin)) * (double)(pictureWidth - 2 * serviceSpaceGap);
            }

            #endregion Прописываем текстовые маркеры


            #region проставляем квантили, если надо

            if (cbShowQuantiles.Checked)
            {
                for (int i = 0; i < histToRepresent.quantilesList.Count; i++)
                {
                    double binCenter            = histToRepresent.quantilesList[i];
                    int    xCoordinateBinCenter = Convert.ToInt32(serviceSpaceGap + (binCenter - xSpaceMin) * koeffX);
                    Point  ptTop    = new Point(xCoordinateBinCenter, pictureHeight - serviceSpaceGap);
                    Point  ptBottom = new Point(xCoordinateBinCenter, serviceSpaceGap);
                    theImage.Draw(new LineSegment2D(ptTop, ptBottom), colorGreen, 2);
                }

                double medianCenter            = histToRepresent.Median;
                int    xCoordinateMedianCenter = Convert.ToInt32(serviceSpaceGap + (medianCenter - xSpaceMin) * koeffX);
                Point  ptMedianTop             = new Point(xCoordinateMedianCenter, pictureHeight - serviceSpaceGap);
                Point  ptMedianBottom          = new Point(xCoordinateMedianCenter, serviceSpaceGap);
                theImage.Draw(new LineSegment2D(ptMedianTop, ptMedianBottom), colorRed, 2);

                double perc5Center            = histToRepresent.Perc5;
                int    xCoordinateperc5Center = Convert.ToInt32(serviceSpaceGap + (perc5Center - xSpaceMin) * koeffX);
                Point  ptPerc5Top             = new Point(xCoordinateperc5Center, pictureHeight - serviceSpaceGap);
                Point  ptPerc5Bottom          = new Point(xCoordinateperc5Center, serviceSpaceGap);
                theImage.Draw(new LineSegment2D(ptPerc5Top, ptPerc5Bottom), colorRed, 2);
            }
            #endregion проставляем квантили, если надо


            if (rbtnShowAsBars.Checked)
            {
                double dBarWidth = (double)pictureWidth - 2.0d * (double)serviceSpaceGap;
                int    barsCount = histToRepresent.BinsCount;
                dBarWidth = dBarWidth / (double)barsCount;
                dBarWidth = dBarWidth / 3.0d;
                barWidth  = Convert.ToInt32(dBarWidth);
                barWidth  = (barWidth < 1) ? (1) : (barWidth);
                int barWidthHalfed = Convert.ToInt32(dBarWidth / 2.0d);
                barWidthHalfed = (barWidthHalfed < 1) ? (1) : (barWidthHalfed);


                for (int i = 0; i < histToRepresent.BinsCount; i++)
                {
                    double binCenter            = histToRepresent.dvbinsCenters[i];
                    double probDens             = histToRepresent.dvProbDens[i];
                    int    xCoordinateBinCenter = Convert.ToInt32(serviceSpaceGap + (binCenter - xSpaceMin) * koeffX);
                    int    yCoordinateTop       = Convert.ToInt32(pictureHeight - serviceSpaceGap - probDens * koeffY);
                    yCoordinateTop = (yCoordinateTop == pictureHeight - serviceSpaceGap)
                        ? (pictureHeight - serviceSpaceGap - 2)
                        : (yCoordinateTop);
                    Point ptUperLeft = new Point(xCoordinateBinCenter - barWidthHalfed, yCoordinateTop);
                    Size  barSize    = new Size(barWidth, pictureHeight - serviceSpaceGap - yCoordinateTop);

                    theImage.Draw(new Rectangle(ptUperLeft, barSize), new Bgr(histToRepresent.color), -1);
                }
            }
            else
            {
                for (int i = 0; i < histToRepresent.BinsCount; i++)
                {
                    double binCenter            = histToRepresent.dvbinsCenters[i];
                    double probDens             = histToRepresent.dvProbDens[i];
                    int    xCoordinateBinCenter = Convert.ToInt32(serviceSpaceGap + (binCenter - xSpaceMin) * koeffX);
                    int    yCoordinateTop       = Convert.ToInt32(pictureHeight - serviceSpaceGap - probDens * koeffY);
                    PointF ptToShow             = new PointF((float)xCoordinateBinCenter, (float)yCoordinateTop);

                    theImage.Draw(new CircleF(ptToShow, 4), new Bgr(histToRepresent.color), -1);
                }
            }

            string str2Show = "[" + histToRepresent.description + "]" + Environment.NewLine;
            //str2Show += "color: " + histToRepresent.color.ToString() + Environment.NewLine;
            str2Show += "perc5 = " + histToRepresent.Perc5.ToString("e") + Environment.NewLine;
            str2Show += "median = " + histToRepresent.Median.ToString("e") + Environment.NewLine;
            str2Show += "mean = " + histToRepresent.stats.Mean.ToString("e") + Environment.NewLine;
            str2Show += "stdDev = " + histToRepresent.stats.StandardDeviation.ToString("e") + Environment.NewLine;
            str2Show += "min value = " + histToRepresent.stats.Minimum.ToString("e") + Environment.NewLine;
            str2Show += "max value = " + histToRepresent.stats.Maximum.ToString("e") + Environment.NewLine;
            ThreadSafeOperations.SetTextTB(tbStats, str2Show, true);

            ThreadSafeOperations.UpdatePictureBox(pbHistRepresentation, theImage.Bitmap, false);
        }
Exemplo n.º 9
0
 public void ImageConditionAndDataRepresentingForm_Paint(object sender, PaintEventArgs e)
 {
     ThreadSafeOperations.UpdatePictureBox(pbRes, imgData.dataRepresentingImageColored(), true);
     ThreadSafeOperations.UpdatePictureBox(pbScale, imgData.currentColorSchemeRuler.RulerBitmap(pbScale.Width, pbScale.Height), false);
 }