void DoShowHighlight(double imageX, double imageY) { //If we were out of sync, and the first command //was a ShowHighlight, ignore it, since we don't //have an image yet. if (ImageControl.Source == null) { return; } var imagePos = new Point(imageX * ImageControl.ActualWidth, imageY * ImageControl.ActualHeight); var canvasPos = ImageControl.TranslatePoint(imagePos, canvas); var h = new Controls.CircleHighlight(); Canvas.SetLeft(h, canvasPos.X - h.Width / 2); Canvas.SetTop(h, canvasPos.Y - h.Height / 2); canvas.Children.Add(h); }
void DoShowHighlight(double imageX, double imageY) { //If we were out of sync, and the first command //was a ShowHighlight, ignore it, since we don't //have an image yet. if (ImageControl.Source == null) return; var imagePos = new Point(imageX * ImageControl.ActualWidth, imageY * ImageControl.ActualHeight); var canvasPos = ImageControl.TranslatePoint(imagePos, canvas); var h = new Controls.CircleHighlight(); Canvas.SetLeft(h, canvasPos.X - h.Width / 2); Canvas.SetTop(h, canvasPos.Y - h.Height / 2); canvas.Children.Add(h); }