7 changed files with 106 additions and 71 deletions
@ -1,45 +1,52 @@ |
|||
<UserControl xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:Class="ControlCatalog.Pages.ImagePage"> |
|||
<StackPanel Orientation="Vertical" Spacing="4"> |
|||
<TextBlock Classes="h1">Image</TextBlock> |
|||
<TextBlock Classes="h2">Displays an image</TextBlock> |
|||
|
|||
<StackPanel Orientation="Horizontal" |
|||
Margin="0,16,0,0" |
|||
HorizontalAlignment="Center" |
|||
Spacing="16"> |
|||
<StackPanel Orientation="Vertical"> |
|||
<TextBlock>No Stretch</TextBlock> |
|||
<Image Source="/Assets/delicate-arch-896885_640.jpg" |
|||
Width="100" Height="200" |
|||
Stretch="None"/> |
|||
</StackPanel> |
|||
|
|||
<StackPanel Orientation="Vertical"> |
|||
<TextBlock>Fill</TextBlock> |
|||
<Image Source="/Assets/delicate-arch-896885_640.jpg" |
|||
Width="100" Height="200" |
|||
Stretch="Fill"/> |
|||
</StackPanel> |
|||
<DockPanel> |
|||
<StackPanel DockPanel.Dock="Top" Orientation="Vertical" Spacing="4"> |
|||
<TextBlock Classes="h1">Image</TextBlock> |
|||
<TextBlock Classes="h2">Displays an image</TextBlock> |
|||
</StackPanel> |
|||
|
|||
<StackPanel Orientation="Vertical"> |
|||
<TextBlock>Uniform</TextBlock> |
|||
<Image Source="/Assets/delicate-arch-896885_640.jpg" |
|||
Width="100" Height="200" |
|||
Stretch="Uniform"/> |
|||
</StackPanel> |
|||
<Grid ColumnDefinitions="*,*" RowDefinitions="Auto,*" Margin="64"> |
|||
|
|||
<DockPanel Grid.Column="0" Grid.Row="1" Margin="16"> |
|||
<TextBlock DockPanel.Dock="Top" Classes="h3" Margin="0 8">Bitmap</TextBlock> |
|||
<ComboBox Name="bitmapStretch" DockPanel.Dock="Top" SelectedIndex="2" SelectionChanged="BitmapStretchChanged"> |
|||
<ComboBoxItem>None</ComboBoxItem> |
|||
<ComboBoxItem>Fill</ComboBoxItem> |
|||
<ComboBoxItem>Uniform</ComboBoxItem> |
|||
<ComboBoxItem>UniformToFill</ComboBoxItem> |
|||
</ComboBox> |
|||
<Image Name="bitmapImage" |
|||
Source="/Assets/delicate-arch-896885_640.jpg"/> |
|||
</DockPanel> |
|||
|
|||
<StackPanel Orientation="Vertical"> |
|||
<TextBlock>UniformToFill</TextBlock> |
|||
<Image Source="/Assets/delicate-arch-896885_640.jpg" |
|||
Width="100" Height="200" |
|||
Stretch="UniformToFill"/> |
|||
</StackPanel> |
|||
</StackPanel> |
|||
<StackPanel Orientation="Vertical"> |
|||
<TextBlock>Window Icon as an Image</TextBlock> |
|||
<Image Name="Icon" Width="100" Height="200" Stretch="None" /> |
|||
</StackPanel> |
|||
</StackPanel> |
|||
<DockPanel Grid.Column="1" Grid.Row="1" Margin="16"> |
|||
<TextBlock DockPanel.Dock="Top" Classes="h3" Margin="0 8">Drawing</TextBlock> |
|||
<ComboBox Name="drawingStretch" DockPanel.Dock="Top" SelectedIndex="2" SelectionChanged="DrawingStretchChanged"> |
|||
<ComboBoxItem>None</ComboBoxItem> |
|||
<ComboBoxItem>Fill</ComboBoxItem> |
|||
<ComboBoxItem>Uniform</ComboBoxItem> |
|||
<ComboBoxItem>UniformToFill</ComboBoxItem> |
|||
</ComboBox> |
|||
<Image Name="drawingImage"> |
|||
<Image.Source> |
|||
<DrawingImage> |
|||
<GeometryDrawing Brush="Red"> |
|||
<PathGeometry> |
|||
<PathFigure StartPoint="0,0" IsClosed="True"> |
|||
<QuadraticBezierSegment Point1="50,0" Point2="50,-50" /> |
|||
<QuadraticBezierSegment Point1="100,-50" Point2="100,0" /> |
|||
<LineSegment Point="50,0" /> |
|||
<LineSegment Point="50,50" /> |
|||
</PathFigure> |
|||
</PathGeometry> |
|||
</GeometryDrawing> |
|||
</DrawingImage> |
|||
</Image.Source> |
|||
</Image> |
|||
</DockPanel> |
|||
</Grid> |
|||
|
|||
</DockPanel> |
|||
</UserControl> |
|||
|
|||
Loading…
Reference in new issue