ImageGear Professional v18.2 > User Guide > Using ImageGear > Using ImageGear GUI Component > GUI Dialogs Control (IGGUIDlgCtl) |
The IGGUIDlgCtl Control control is provided to save the ImageGear programmer from having to develop application dialog-boxes for 18 of the more commonly used ImageGear functions. The functions are broken into 3 categories:
Display | Functions that affect how the image appears on the screen (or on printed output), but not the actual image itself. |
Processing | Functions that modify the actual image itself. |
Miscellaneous | Functions, like "file open dialog", that don't fit in either of the two other categories. |
The functions provided by the GUI Dialogs control are:
dspl_Alignment | Sets the alignment of the image within the display window. |
dspl_Antialiasing | Controls the anti-aliasing applied to text in scanned pages. |
dspl_Background | Controls the background areas within the display window. |
dspl_Dither | Controls the dithering of high-bit-depth images to low-bit-depth output. |
dspl_Fit | Controls the way that the image is fit within the display window. |
dspl_Gamma | Controls the contrast, brightness, and gamma-correction used to display an image (as opposed to ip_Gamma, below). |
dspl_Orientation | Controls the orientation of the image (e.g., landscape or portrait) within the display window. |
ip_Crop | Provides a means for the user to crop the actual image. |
ip_Gamma | Provides a means for the user to set the brightness, contrast, and gamma-correction of the actual image (as opposed to dspl_Gamma, above). |
ip_Resize | Provides a means for the user to resize the actual image. |
ip_Rotate | Provides a means for the user to rotate the actual image. |
info_File | Displays information about an image file. |
info_Page | Displays information about the image in an IGPage Object. |
load_File | An ImageGear enhanced version of the standard file-chooser dialog. |
open_Dir | The standard directory-chooser dialog. |
print_Page | An ImageGear enhanced version of the Print dialog. |
save_File | An ImageGear enhanced version of the standard Save-As dialog. |
The load/save related dialogs are different than those in IGDlgsCtl Control: the dialogs in IGGUIDlgCtl Control only perform the file-chooser function (they do not include the call to IGFormatsCtl Control to actually load or save the file). |
To use the IGGUIDlgCtl Control ActiveX control, you must first make an instance of the control available. In Visual Basic, this is done as follows:
You'll then have the IGGUIDlgCtl Control on your Toolbox. You can then place a copy of the control on your application by double-clicking the control icon in the toolbox. For example, after placing the control on the "MainFrm" form in the sample GUIDlg program, the Visual Basic editor looks like this:
The Toolbar icon for the control is shown in the red box on the left, and the instance of the control (named IGGUIDlgCtl1) is shown in the red box on the right.
There are some properties of the IGGUIDlgCtl Control that should be set once, when your application starts up. The VB code to do this is best placed in the Form_Load subroutine. In the sample GUIDlg program, it looks like this:
Copy Code
|
|
---|---|
On Error GoTo ErrorHandler IGGUIDlgCtl1.CoreCtl = IGCoreCtl1 IGGUIDlgCtl1.FormatsCtl = IGFormatsCtl1 IGGUIDlgCtl1.DisplayCtl = IGDisplayCtl1 IGGUIDlgCtl1.ProcessingCtl = IGProcessingCtl1 IGGUIDlgCtl1.EffectsCtl = IGEffectsCtl1 Exit Sub ErrorHandler: MsgBox "ImageGear GUIDlg control returned an error (" + Hex(Err.Number) + "):" + vbCrLf + Err.Description, vbExclamation, "IGGUIDlg Error" End Sub |
Like the other ImageGear GUI controls, IGGUIDlgCtl Control uses the COM Error object to report errors. VB programmers use the On Error statement to specify how to handle errors. After each call to an IGGUIDlgCtl Control method, if there was an error, then the program can inspect Err.Number and Err.Description to determine what went wrong. The list of possible Err.Number values is in the enumIGGUIDlgCtlErrors Enumeration.
Sometimes the error is detected by the ImageGear controls. In that case, the Err.Number and Err.Description values will be those generated by the ImageGear control. |