<Canvas x:Name="cvsBurstImage" MouseLeftButtonDown="cvsBurstImage_MouseLeftButtonDown" Style="{StaticResource BurstCanvasStyle}">
<Viewbox x:Name="vbBurstImage" Style="{StaticResource ViewboxCanvasStyle}">
<Image x:Name="imgBurstImage" Source="../Assets/Images/default_burst_image.png" ImageFailed="imgBurstImage_ImageFailed"/>
</Viewbox>
</Canvas>
I am facing a strange problem where i need to draw rectangles on a canvas and make them resizable as well as as moveable (place them anywhere in canvas).
I have achieved this via mouse events of canvas;
private void Canvas_MouseLeftButtonDown(object sender,MouseButtonEventArgs e) {}
private void Canvas_MouseMove(object sender, MouseEventArgs e) {}
private void Canvas_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) {}
Explanation; On MouseLeftButtonDown, i start capturing mouse cordinates and continue doing so with mouse move (make height and width with these cordinates), on MouseLeftButtonUp i stop listening to mouse and draw these cordinates as Rectangle on canvas and add this rectangle to canvas as child element.
I Also need the Rectangle Re-sizable and Movable functionalities.
Can u please provide me how to achieve the Rectangle Re-sizable and Movable functionalities.?
Thanks....