In some scenarios, it may be necessary to place controls in absolute positions in a given area. Such a task can be performed using the
Canvas control. In this recipe, you will learn how to place a rectangle and an ellipse over the image in a fixed location, specified in pixels from the top-left corner.
To step through this recipe, you only need the automatically generated project.
To create a page presenting how to arrange controls in absolute positions, perform the following steps:
Image.jpgfile to the
MainPage.xamlfile as follows:
<Page (...) Background="Black"> <Canvas> <Canvas.Background> <ImageBrush ImageSource="/Assets/Image.jpg" ...