I am tryin to add rectangle to on to an image in wpf. Rectangle is drawn at MouseLeftButtonDown event.
Problem is I want to add this rectangle straight to the Grid (on to the image) without using a canvas.
How Can I do that? or
How can I avoid using a canvas?
<UserControl>
<Grid x:Name="LayoutRoot"
MouseLeftButtonDown= "OnMouseLeftButtonDown"
MouseLeftButtonUp="OnMouseLeftButtonUp"
MouseMove="OnMouseMove"
Background="Transparent"
>
<Canvas x:Name="canvas">
<Image Name="image" Source=".....\Penguins.jpg"/>
<Rectangle
x:Name="selectionBox"
StrokeThickness="1"
Stroke="Black"
Visibility="Collapsed"
/>
</Canvas>
</Grid>
</UserControl>
Thankx in advance