Example #1
0
 private void PictureBoxAdapter_MouseOverPixel(object sender, MousePixelEventsArgs e)
 {
     if (this.project.ImageGrid == null)
     {
         this.activeColorToolStripLabel.BackColor = e.Color;
     }
 }
Example #2
0
        private bool TryGetColor(Point point, out MousePixelEventsArgs args)
        {
            if (this.pictureBox.Image != null)
            {
                Point?imagePoint = TranslateToImage(point);

                if (imagePoint.HasValue)
                {
                    args = new MousePixelEventsArgs(
                        imagePoint.Value,
                        ((Bitmap)this.pictureBox.Image).GetPixel(imagePoint.Value.X, imagePoint.Value.Y));
                    return(true);
                }
            }

            args = null;
            return(false);
        }