Skip to content

Commit

Permalink
feat(imagebrush): Improved the support of ImageBrush on Wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
carldebilly committed Nov 23, 2020
1 parent 26c0b06 commit af15d91
Show file tree
Hide file tree
Showing 13 changed files with 290 additions and 297 deletions.
Original file line number Diff line number Diff line change
@@ -1,64 +1,48 @@
<UserControl
x:Class="GenericApp.Views.Content.UITests.ImageBrushTestControl.BorderImageBrushRelativeTransform"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:GenericApp.Views.Content.UITests.ImageBrushTestControl"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ios="http://nventive.com/ios"
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:android="http://nventive.com/android"
xmlns:not_ios="http://nventive.com/not_ios"
xmlns:shapes="clr-namespace:nVentive.Umbrella.Views.UI.Xaml.Shapes;assembly=nVentive.Umbrella"
mc:Ignorable="d not_ios android"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:u="using:nVentive.Umbrella.Views.Controls"
xmlns:controls="using:Uno.UI.Samples.Controls"
xmlns:uBehaviors="using:nVentive.Umbrella.Views.Behaviors"
d:DesignHeight="300"
d:DesignWidth="400">
x:Class="GenericApp.Views.Content.UITests.ImageBrushTestControl.BorderImageBrushRelativeTransform"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:GenericApp.Views.Content.UITests.ImageBrushTestControl"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ios="http://nventive.com/ios"
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:android="http://nventive.com/android"
xmlns:not_ios="http://nventive.com/not_ios"
mc:Ignorable="d not_ios android"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="300"
d:DesignWidth="400">

<StackPanel>
<Border>
<controls:SampleControl SampleDescription="BorderImageBrushRelativeTransform">
<controls:SampleControl.SampleContent>
<DataTemplate>

<StackPanel >
<Border BorderThickness="30"
Width="200"
Height="100">
<Border.Background>
<ImageBrush ImageSource="http://lh5.ggpht.com/lxBMauupBiLIpgOgu5apeiX_YStXeHRLK1oneS4NfwwNt7fGDKMP0KpQIMwfjfL9GdHRVEavmg7gOrj5RYC4qwrjh3Y0jCWFDj83jzg">
<ImageBrush.RelativeTransform>
<ScaleTransform ScaleX="2"
ScaleY="3"
CenterX=".5"
CenterY=".5" />
</ImageBrush.RelativeTransform>
</ImageBrush>
</Border.Background>
</Border>
<StackPanel >
<Border BorderThickness="30"
Width="200"
Height="100">
<Border.Background>
<ImageBrush ImageSource="http://lh5.ggpht.com/lxBMauupBiLIpgOgu5apeiX_YStXeHRLK1oneS4NfwwNt7fGDKMP0KpQIMwfjfL9GdHRVEavmg7gOrj5RYC4qwrjh3Y0jCWFDj83jzg">
<ImageBrush.RelativeTransform>
<ScaleTransform ScaleX="2"
ScaleY="3"
CenterX=".5"
CenterY=".5" />
</ImageBrush.RelativeTransform>
</ImageBrush>
</Border.Background>
</Border>

<Border BorderThickness="30"
Width="600"
Height="300">
<Border.Background>
<ImageBrush ImageSource="http://lh5.ggpht.com/lxBMauupBiLIpgOgu5apeiX_YStXeHRLK1oneS4NfwwNt7fGDKMP0KpQIMwfjfL9GdHRVEavmg7gOrj5RYC4qwrjh3Y0jCWFDj83jzg">
<ImageBrush.RelativeTransform>
<ScaleTransform ScaleX="2"
ScaleY="3"
CenterX=".5"
CenterY=".5" />
</ImageBrush.RelativeTransform>
</ImageBrush>
</Border.Background>
</Border>
<Border BorderThickness="30"
Width="600"
Height="300">
<Border.Background>
<ImageBrush ImageSource="http://lh5.ggpht.com/lxBMauupBiLIpgOgu5apeiX_YStXeHRLK1oneS4NfwwNt7fGDKMP0KpQIMwfjfL9GdHRVEavmg7gOrj5RYC4qwrjh3Y0jCWFDj83jzg">
<ImageBrush.RelativeTransform>
<ScaleTransform ScaleX="2"
ScaleY="3"
CenterX=".5"
CenterY=".5" />
</ImageBrush.RelativeTransform>
</ImageBrush>
</Border.Background>
</Border>

</StackPanel>
</DataTemplate>
</controls:SampleControl.SampleContent>
</controls:SampleControl>
</Border>

</StackPanel>
</StackPanel>
</UserControl>
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Uno.UI.Samples.Controls;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Uno.UI.Samples.Controls;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace GenericApp.Views.Content.UITests.ImageBrushTestControl
{
[SampleControlInfo("ImageBrushTestControl", "BorderImageBrushRelativeTransform")]
public sealed partial class BorderImageBrushRelativeTransform : UserControl
{
public BorderImageBrushRelativeTransform()
{
this.InitializeComponent();
}
}
[Sample]
public sealed partial class BorderImageBrushRelativeTransform : UserControl
{
public BorderImageBrushRelativeTransform()
{
this.InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<UserControl
x:Class="Uno.UI.Samples.UITests.ImageBrushTestControl.DoubleImageBrushInList"
xmlns:controls="using:Uno.UI.Samples.Controls"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Uno.UI.Samples.UITests.ImageBrushTestControl"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:u="using:Uno.UI.Samples.Controls"
Expand All @@ -14,37 +12,29 @@
d:DesignHeight="2000"
d:DesignWidth="400">

<controls:SampleControl SampleDescription="DoubleImageBrushInList - images should appear in duplicate, used for testing concurrency issues with ImageBrush and image loading libraries">
<controls:SampleControl.SampleContent>
<DataTemplate x:DataType="local:DoubleImageBrushInList">
<ListView ItemsSource="{x:Bind SampleItemsLarge}"
Width="400"
Height="500">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel>
<ListView ItemsSource="{x:Bind SampleItemsLarge}"
Width="400"
Height="500">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Height="40" Foreground="Black">
<Run Text="Image uri: "/><Run Text="{Binding Uri}"/>
</TextBlock>
<StackPanel Orientation="Horizontal">
<Border Width="200" Height="100">
<Border.Background>
<ImageBrush ImageSource="{Binding Uri}"/>
</Border.Background>
</Border>
<Border Width="200" Height="100">
<Border.Background>
<ImageBrush ImageSource="{Binding Uri}"/>
</Border.Background>
</Border>
</StackPanel>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackPanel>
<TextBlock Height="40" Foreground="Black">
<Run Text="Image uri: "/><Run Text="{Binding Uri}"/>
</TextBlock>
<StackPanel Orientation="Horizontal">
<Border Width="200" Height="100">
<Border.Background>
<ImageBrush ImageSource="{Binding Uri}"/>
</Border.Background>
</Border>
<Rectangle Width="200" Height="100">
<Rectangle.Fill>
<ImageBrush ImageSource="{Binding Uri}"/>
</Rectangle.Fill>
</Rectangle>
</StackPanel>
</StackPanel>
</DataTemplate>
</controls:SampleControl.SampleContent>
</controls:SampleControl>
</ListView.ItemTemplate>
</ListView>
</UserControl>
Loading

0 comments on commit af15d91

Please sign in to comment.