钟表案例
window中的代码
<Window x:Class="钟表.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:钟表"
mc:Ignorable="d"
Title="MainWindow" Height="500" Width="500" Loaded="Window_Loaded" WindowStyle="None" WindowStartupLocation="CenterScreen">
// WindowStyle="None" 无边框
// WindowStartupLocation="CenterScreen" 设置窗口居中显示
<Canvas Name="BG" Visibility="Visible">
//数字1-12
//数字1
<Image Source="img/1.png" Width="20" Height="30" Stretch="Fill" Canvas.Left="304" Canvas.Top="131" />
//数字2
<Image Source="img/2.png" Width="20" Height="30" Stretch="Fill" Canvas.Left="346" Canvas.Top="170" />
//数字3
<Image Source="img/3.png" Width="20" Height="30" Stretch="Fill" Canvas.Left="368" Canvas.Top="236" />
//数字4
<Image Source="img/4.png" Width="20" Height="30" Stretch="Fill" Canvas.Left="348" Canvas.Top="301" />
//数字