Beispiel #1
0
        private void UpdateLabels(int x, int y)
        {
            positionX.Text = x.ToString();
            positionY.Text = y.ToString();

            byte      intensity     = Image.GetIntensity(x, y);
            Color     originalRgba  = Image.GetRgbaColor(x, y);
            Color     convertedRgba = Image.GetConvertedRgbaColor(x, y);
            HsvColor  hsv           = Image.GetHsvColor(x, y);
            CmykColor cmyk          = Image.GetCmykColor(x, y);
            YuvColor  yuv           = Image.GetYuvColor(x, y);

            intensityTextBlock.Text = intensity.ToString();

            originalRedTextBlock.Text   = originalRgba.R.ToString();
            originalGreenTextBlock.Text = originalRgba.G.ToString();
            originalBlueTextBlock.Text  = originalRgba.B.ToString();
            originalAlphaTextBlock.Text = originalRgba.A.ToString();

            convertedRedTextBlock.Text   = convertedRgba.R.ToString();
            convertedGreenTextBlock.Text = convertedRgba.G.ToString();
            convertedBlueTextBlock.Text  = convertedRgba.B.ToString();
            convertedAlphaTextBlock.Text = convertedRgba.A.ToString();

            hueTextBlock.Text        = String.Format("{0:0.#}", hsv.Hue);
            saturationTextBlock.Text = String.Format("{0:0.##}", hsv.Saturation);
            valueTextBlock.Text      = String.Format("{0:0.##}", hsv.Value);

            cyanTextBlock.Text    = String.Format("{0:0.##}", cmyk.Cyan);
            magentaTextBlock.Text = String.Format("{0:0.##}", cmyk.Magenta);
            yellowTextBlock.Text  = String.Format("{0:0.##}", cmyk.Yellow);
            blackTextBlock.Text   = String.Format("{0:0.##}", cmyk.Black);

            yTextBlock.Text = String.Format("{0:0.##}", yuv.Luma);
            uTextBlock.Text = String.Format("{0:0.##}", yuv.ColorDifferenceU);
            vTextBlock.Text = String.Format("{0:0.##}", yuv.ColorDifferenceV);
        }
 public static Color CmykToRgb(CmykColor cmykColor)
 {
     return(CmykToRgb(cmykColor.Cyan, cmykColor.Magenta, cmykColor.Yellow, cmykColor.Black));
 }