-
Notifications
You must be signed in to change notification settings - Fork 723
Expand file tree
/
Copy pathImagePage.xaml
More file actions
122 lines (108 loc) · 5.07 KB
/
ImagePage.xaml
File metadata and controls
122 lines (108 loc) · 5.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<Page
x:Class="WinUIGallery.ControlPages.ImagePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:WinUIGallery.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<StackPanel>
<controls:ControlExample x:Name="Example1" HeaderText="A basic image from a local file.">
<Image Height="100" Source="/Assets/SampleMedia/treetops.jpg" />
<controls:ControlExample.Xaml>
<x:String>
<Image Source="/Assets/SampleMedia/treetops.jpg" Height="100" />
</x:String>
</controls:ControlExample.Xaml>
</controls:ControlExample>
<controls:ControlExample x:Name="Example2" HeaderText="An image decoded to the rendering size">
<Image Height="100">
<Image.Source>
<BitmapImage DecodePixelHeight="100" UriSource="/Assets/SampleMedia/treetops.jpg" />
</Image.Source>
</Image>
<controls:ControlExample.Xaml>
<x:String xml:space="preserve">
<Image Height="100">
<Image.Source>
<BitmapImage UriSource="/Assets/SampleMedia/treetops.jpg"
DecodePixelHeight="100" />
</Image.Source>
</Image>
</x:String>
</controls:ControlExample.Xaml>
</controls:ControlExample>
<controls:ControlExample x:Name="Example3" HeaderText="Image stretching.">
<Image
x:Name="StretchImage"
Width="100"
Height="100"
Source="/Assets/SampleMedia/valley.jpg"
Stretch="None" />
<controls:ControlExample.Options>
<RadioButtons Header="Image stretch mode">
<RadioButton
x:Name="StretchNone"
Checked="ImageStretch_Checked"
Content="None"
GroupName="ImageStretch"
IsChecked="True" />
<RadioButton
x:Name="StretchFill"
Checked="ImageStretch_Checked"
Content="Fill"
GroupName="ImageStretch" />
<RadioButton
x:Name="StretchUniform"
Checked="ImageStretch_Checked"
Content="Uniform"
GroupName="ImageStretch" />
<RadioButton
x:Name="StretchUniformToFill"
Checked="ImageStretch_Checked"
Content="UniformToFill"
GroupName="ImageStretch" />
</RadioButtons>
</controls:ControlExample.Options>
<controls:ControlExample.Xaml>
<x:String>
<Image Stretch="$(Stretch)" Height="100" Width="100" Source="/Assets/SampleMedia/valley.jpg" />
</x:String>
</controls:ControlExample.Xaml>
<controls:ControlExample.Substitutions>
<controls:ControlExampleSubstitution Key="Stretch" Value="{x:Bind StretchImage.Stretch, Mode=OneWay}" />
</controls:ControlExample.Substitutions>
</controls:ControlExample>
<controls:ControlExample x:Name="Example4" HeaderText="Nine grid images.">
<StackPanel>
<TextBlock Text="The normal image" />
<Image Height="82" Source="/Assets/SampleMedia/ninegrid.gif" />
<TextBlock Text="Image stretched evenly" />
<Image
Height="164"
NineGrid="3,3,3,3"
Source="/Assets/SampleMedia/ninegrid.gif" />
<TextBlock Text="Image stretched using nine grid" />
<Image
Height="164"
NineGrid="30,20,30,20"
Source="/Assets/SampleMedia/ninegrid.gif" />
</StackPanel>
<controls:ControlExample.Xaml>
<x:String xml:space="preserve">
<Image Source="/Assets/SampleMedia/ninegrid.gif" Height="82" />
<Image Source="/Assets/SampleMedia/ninegrid.gif" NineGrid="3,3,3,3" Height="164" />
<Image Source="/Assets/SampleMedia/ninegrid.gif" NineGrid="30,20,30,20" Height="164" />
</x:String>
</controls:ControlExample.Xaml>
</controls:ControlExample>
<controls:ControlExample x:Name="Example5" HeaderText="An SVG image.">
<Image Height="100" Source="/Assets/SampleMedia/MirrorPCConsent.svg" />
<controls:ControlExample.Xaml>
<x:String>
<Image Source="/Assets/SampleMedia/MirrorPCConsent.svg" Height="100" />
</x:String>
</controls:ControlExample.Xaml>
</controls:ControlExample>
</StackPanel>
</Page>