Skip to main content

Posts

Showing posts with the label UWP Canvas

UWP - Drawing on a Canvas example

MainPage.xaml <Page x:Class="UniversalAppTutorials.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:UniversalAppTutorials" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" > <Canvas x:Name="Canvas1" Background="AliceBlue"> </Canvas> </Page> MainPage.xaml.cs using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Shapes; using Windows.UI.Xaml.Media; using Windows.UI; namespace UniversalAppTutorials { public sealed partial class MainPage : Page { public MainPage() { this.InitializeComponent(); DarwOnCanvas(); } void DarwOnCanvas() { // Initialize a new...

UWP - Canvas example

MainPage.xaml <Page x:Class="UniversalAppTutorials.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:UniversalAppTutorials" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" > <!-- Canvas Defines an area within which you can explicitly position child objects, using coordinates that are relative to the Canvas area. Canvas.ZIndex Gets or sets the Z-order of an element when that element is presented in its parent Canvas layout container. --> <Canvas Background="AliceBlue"> <Ellipse Width="100" Height="100" ...