LEADTOOLS Support
General
LEADTOOLS SDK Examples
How-To: Use Example Dialogues Included with the SDK
#1
Posted
:
Friday, September 29, 2017 4:51:49 PM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 163
Was thanked: 9 time(s) in 9 post(s)
The LEADTOOLS SDK comes installed with a wide variety of demos for which example code is included. This sample code can be included to alleviate development needs. Our MainDemo includes source code for multiple dialogue windows that can be used to collect parameters from end-users. The source code for these dialogues can be found in the installation folder:
C:\LEADTOOLS 19\Examples\DotNet\CS\MainDemo\UI\CommandThis will demonstrate how to incorporate the FlipDialog into your application. Note each dialogue consists of four separate files. In this case:
- FlipDialog.cs -- contains the actual logic exposed to the developer
- FlipDialog.Designer.cs -- contains the designer-generated code that determines how the form is styled. (This code is updated when the form is modified in the designer and it is tpyically not necessary to edit this file directly).
- FlipDialog.resx -- resource file containing strings for the current system language.
- FlipDialog.resx.ja -- resource file containing strings for the Japanese language. Additional resource files can be added to accommodate localization to other languages.
The dialog can be added by right-clicking the project in Visual Studio and from the context menu selecting Add -> Existing Item. In the dialogue, select
only the basic file (in this case FlipDialog.cs) and click OK. Visual Studio will copy this file--as well as the .Designer.cs and the .resx files it depends upon--to the project folder.
These transferred files can be modified without causing the originals to be modified, such as changing titles, text labels, and namespaces. It will be necessary to either change the namespace to the one used by the project or add a using directive for the "MainDemo" namespace where the dialogue will be used.
Note the FlipCommand has only one property that can be set: the "Horizontal" property to determine the direction of the flip. In the UI this is displayed as giving the user a choice between Vertical and Horizontal:
This is exposed through the FlipDialog and can be implemented as such:
Code:
FlipCommand flipCommand = new FlipCommand();
FlipDialog flipDialog = new FlipDialog();
if (flipDialog.ShowDialog() == DialogResult.OK)
{
flipCommand.Horizontal = flipDialog.Horizontal;
flipCommand.Run(rasterImage);
}
Note there are many other image processing commands available, and pre-created dialogues which can be used with them. These are all available in the LEADTOOLS installation folder.
Edited by moderator Thursday, November 2, 2017 8:22:46 AM(UTC)
| Reason: Not specified
Nick Crook
Developer Support Engineer
LEAD Technologies, Inc.
LEADTOOLS Support
General
LEADTOOLS SDK Examples
How-To: Use Example Dialogues Included with the SDK
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.