I have an image that the user can zoom/scroll. I want to draw some rectangles/circles on a different layer (for example: drawing a circle for each person's face that was identified in the picture).
The rectangle position is relative to the image.
How do I create such an overlay?
An easy way is to just use a Canvas and set the canvas' background property to your photo, and then place your circles or rectangles on top of that and position them with the Canvas.Left and .Top properties.
<Canvas x:Name="myCanvas">
<Canvas.Background>
<ImageBrush ImageSource="c:\photo.bmp"/>
</Canvas.Background>
<Image Canvas.Top="20" Canvas.Left="20" Height="20" Width="20" Source="c:\circle.bmp"/>
</Canvas>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With