Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
WPF_Blend_magnifying_glass

Take the following steps to create and run a program in Microsoft Expression Blend to add a magnifying glass effect using LEADTOOLS BitmapSourceViewer.

  1. Start Microsoft Expression Blend. 
  2. In File-->Open Project find the project ImageBrowser you created in previous tutorial.  Find the ImageBrowser.csproj file name and choose Open
  3. Choose Objects and Timeline-->LayoutRoot, then BitmapSourceViewer.
  4. Resize the Window and BimapSourceViewer to accommodate a picture of approximately 800X600 (Width x Height in pixels) 
  5. On the right side of the screen, find and select Properties-->Miscellaneous-->InteractiveMode.    
  6. Choose drop down menu in InteractiveMode, and set the property to MagnifyGlass.
  7. 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.    
  8.  Notice that additional effects are also available in InteractiveMode that you can try out.
  9. [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>