Take the following steps to create and run a program in Microsoft Expression Blend to add a bitmap effect using LEADTOOLS SpecialEffects.
- Start Microsoft Expression Blend.
- In File-->Open Project find the project ImageBrowser you created in previous tutorial. Find the ImageBrowser.csproj file name and choose Open.
- Choose Objects and Timeline-->LayoutRoot,then BitmapSourceViewer.
- On the right side of the screen, find and select Properties-->Appearance.
- Select the downward arrow located at the bottom of the Appearance box to show advanced properties.
- Choose BitmapEffect-->New. A Select Object window will appear. Find Leadtools.Windows.Media.Effects-->Leadtools.Windows.Media.Effects.SpecialEffects--> ColoredBallsCommandBitmapEffect, select it and choose OK.
- Build, and Run the program to test it (Project-->Test Project or F5).
- Next add multiple effects by repeating steps 4-5.
- Choose BitmapEffect-->New,find the dropdown menu button and select it, then choose BitmapEffectGroup.
- Choose Children(Collection)--> ... (button to Edit Items in this collection).
- Notice the items and properties windows are empty. We are going to add some items to the children collection. Those children items will be as many effects as desired.
- Choose Add another item button. A Select Object window will show. Select: Leadtools.Windows.Media.Effects-->Leadtools.Windows.Media.Effects.SpecialEffects--> ColoredBallsCommandBitmapEffect Choose OK to add item, notice the item is added to the list of children and an index [0] is assigned to it.
- Choose Add another item button. A Select Object window will show. Select: Leadtools.Windows.Media.Effects-->Leadtools.Windows.Media.Effects.SpecialEffects--> BricksTextureCommandBimapEffect Choose OK to add item, notice the item is added to the list of children and an index [1] is assigned to it.
- In the BitmapEffect Collection Editor:Children window, once the two effects are added, choose OK.
- Build, and Run the program to test it (Project-->Test Project or F5).
- To switch from one effect to another, choose Children(Collection)--> ... (button to Edit Items in this collection). Select either up or down arrow, then choose OK.
-
[Window1.xaml]
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Leadtools_Windows_Controls="clr-namespace:Leadtools.Windows.Controls;assembly=Leadtools.Windows.Controls"
x:Class="ImageBrowser.Window1" x:Name="Window" Title="Window1" Width="640" Height="480" xmlns:Leadtools_Windows_Media_Effects_SpecialEffects="clr-namespace:Leadtools.Windows.Media.Effects.SpecialEffects;assembly=Leadtools.Windows.Media.Effects">
<Grid x:Name="LayoutRoot">
<Leadtools_Windows_Controls:BitmapSourceViewer Margin="124,132,205,124" Content="BitmapSourceViewer" ScaleFactor="1" SizeMode="Fit">
<Leadtools_Windows_Controls:BitmapSourceViewer.Source>
<BitmapImage UriSource="C:/Program Files/LEAD Technologies/LEADTOOLS 16/Images/ImageProcessingDemo/NaturalFruits.jpg"/>
</Leadtools_Windows_Controls:BitmapSourceViewer.Source>
<Leadtools_Windows_Controls:BitmapSourceViewer.BitmapEffect>
<Leadtools_Windows_Media_Effects_SpecialEffects:ColoredBallsCommandBitmapEffect/>
</Leadtools_Windows_Controls:BitmapSourceViewer.BitmapEffect>
</Leadtools_Windows_Controls:BitmapSourceViewer>
</Grid>
</Window>