Ejemplo n.º 1
0
        private void InputImage_MouseMove(object sender, MouseEventArgs e)
        {
            Point imagePoint = InputImage.TranslatePointToImageCoordinates(e.Location);

            if ((imagePoint.X >= 0) && (imagePoint.X < InputImage.Image.Width) &&
                (imagePoint.Y >= 0) && (imagePoint.Y < InputImage.Image.Height))
            {
                PixelIntensityLabel.Visible  = true;
                PixelIntensityLabel.Location = new Point(e.X + 10, e.Y + 10);
                PixelIntensityLabel.Text     = "(" + imagePoint.X.ToString()
                                               + ", " + imagePoint.Y.ToString()
                                               + ") Lum = "
                                               + GetLuminance(imagePoint.X, imagePoint.Y).ToString();
            }
            else
            {
                PixelIntensityLabel.Visible = false;
            }
        }