It is very possible if you know the x, y, width and height of the areas you want to select, you can put all the controls in the canvas.
You can set the properties in the rectangles in the code like this:
Rectangle rectangle = new Rectangle();
rectangle.SetValue(Canvas.LeftProperty, 10);
rectangle.SetValue(Canvas.TopProperty, 10);
rectangle.Width = 1000;
rectangle.Height = 50;
rectangle.Fill = new SolidColorBrush() { Color = Colors.Red, Opacity = 0.75f };
canvas.Children.Add(rectangle);
and if you want to add them to xaml you might like this.
<Canvas>
<Image Source="..."/>
<Rectangle Canvas.Left="10" Canvas.Top="10" Width="1000" Height="50">
<Rectangle.Fill>
<SolidColorBrush Color="Red" Opacity="0.75"/>
</Rectangle.Fill>
</Rectangle>
</Canvas>
source
share