checking-image-bounds-transform

Installation
SKILL.md

WPF Image Bounds Checking (With Transforms)

A pattern for checking if mouse coordinates are within the image area and clamping coordinates to image bounds when Pan, Zoom, Rotate transforms are applied.

1. Problem Scenario

Requirements

  • Measurement tools, annotation tools in image viewers should only work within the image area
  • Need accurate boundary detection even when image is zoomed, panned, or rotated

Complexity

  • Image control position varies based on Stretch="None", HorizontalAlignment="Center" settings
  • When RenderTransform applies Pan, Zoom, Rotate, calculating actual image position becomes complex

2. Solution Pattern

2.1 Image Bounds Check Method

Related skills

More from christian289/dotnet-with-claudecode

Installs
1
GitHub Stars
31
First Seen
Feb 28, 2026