Take the following steps to create and run a program in Microsoft Expression Blend to display an image using LEADTOOLS ImageViewer.
- Start Microsoft Expression Blend.
- Choose File->New->Project... from the menu.
- In the Create New Project dialog box, choose "WPF Application (.exe)" in the "Select a project type" field, name the project as "ImageBrowser". choose your desired language, and ".NET Framework 3.5" as the target platform. If desired, type a new location for your project or select a directory using the Browse button, and then choose OK.
- In the "Project" window to the right of the screen, right-click on the "References" folder, and select " Add Reference...". In the "Add Reference..." dialog box, browse to the "<LEADTOOLS_INSTALLDIR> \Bin\Dotnet\Win32 " folder and select the following DLLs:
- Leadtools.dll
- Leadtools.Codecs.dll
- Leadtools.Windows.Controls.dll
- Leadtools.Windows.Media.TransitionBase.dll
- Leadtools.Windows.Media.Transitions.dll
- Make sure Window1.xaml is in design view. From the Asset Library (you may need to left-click the bottom symbol to expand the asset library), choose Custom Controls->RasterImageViewer.
- Place the cursor on the Window1 and draw a rectangular area of approximately 300x200 (Width x Height in pixels).
-
In the "Properties" window to the right of the screen, scroll down to the Miscellaneous-->Source property, and browse to an image to be displayed (For example: C:\Users\Public\Documents\LEADTOOLS Images\ImageProcessingDemo\NaturalFruits.jpg). The image should be displayed in the Leadtools RasterImageViewer. You can adjust the size by changing the fields ScaleFactor or SizeMode.
- Build, and Run the program to test it (Project-->Test Project or F5). [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="640" Height="480" xmlns:Leadtools_Windows_Controls="clr-namespace:Leadtools.Windows.Controls;assembly="Leadtools.Windows.Controls"> <Leadtools_Windows_Controls:RasterImageViewer Width="242" Height="199" Content="RasterImageViewer" Source="NaturalFruits.jpg"/> </Window>