Take the following steps to create and run a program in Microsoft Expression Blend to add a magnifying glass effect using LEADTOOLS BitmapSourceViewer.
- 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.
- Resize the Window and BimapSourceViewer to accommodate a picture of approximately 800X600 (Width x Height in pixels)
- On the right side of the screen, find and select Properties-->Miscellaneous-->InteractiveMode.
- Choose drop down menu in InteractiveMode, and set the property to MagnifyGlass.
- Build, and Run the program to test it (Project-->Test Project or F5). Over the picture, left-click to display the magnifying glass. It can be moved by holding the left mouse button down. You can set the magnifying glass to a fixed position by left-clicking and holding it, then right-clicking.
- Notice that additional effects are also available in InteractiveMode that you can try out.
-
[Window1.xaml]
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="ImageBrowser.Window1" x:Name="Window" Title="Window1" Width="857" Height="640" xmlns:Leadtools_Windows_Controls="clr-namespace:Leadtools.Windows.Controls;assembly=Leadtools.Windows.Controls">
<Grid x:Name="LayoutRoot">
<Leadtools_Windows_Controls:BitmapSourceViewer Margin="24,-1,25,9" Content="BitmapSourceViewer" SizeMode="Stretch" InteractiveMode="MagnifyGlass" InteractiveRegionType="Rectangle" ScaleFactor="3">
<Leadtools_Windows_Controls:BitmapSourceViewer.Source>
<BitmapImage UriSource="C:\Users\Public\Documents\LEADTOOLS Images\ImageProcessingDemo\NaturalFruits.jpg"/>
</Leadtools_Windows_Controls:BitmapSourceViewer.Source>
</Leadtools_Windows_Controls:BitmapSourceViewer>
</Grid>
</Window>