#include "ltwrappr.h"
virtual L_INT LDialogDocument::DoModalInvertedText(hWndOwner)
Displays the Inverted Text dialog box, and gets the options for LBitmap::InvertedText. This function is available in the Document/MedicalDocument/Medical toolkits.
Handle of the window which owns the dialog.
Value | Meaning |
---|---|
SUCCESS_DLG_OK | The "OK" button was pressed, and the dialog exited successfully. |
SUCCESS_DLG_CANCEL | The "Cancel" button was pressed, and the dialog exited successfully. |
< 1 | An error occurred. Refer to Return Codes. |
LDialogDocument::SetInvertedTextParams must be called before using this function to set the initial values for the dialog. You can get the updated INVERTEDTEXTDLGPARAMS with the values entered by the user through the dialog by using LDialogDocument::GetInvertedTextParams.
The LBitmap::InvertedText function only works with 1-bit images. If you provide a bitmap in the LDialogDocument class, it must be a 1-bit bitmap.
The Inverted Text dialog.
Required DLLs and Libraries
L_INT LDialogDocument_DoModalInvertedTextExample(LBitmap * pBitmap, HWND hWnd)
{
L_INT nRet;
LDialogDocument DlgDocument;
nRet = LDialogDocument::Initialize(0);
if(nRet != SUCCESS)
return nRet;
DlgDocument.SetBitmap(pBitmap);
LBitmap BitmapRegion;
INVERTEDTEXTDLGPARAMS DlgParams;
memset ( &DlgParams, 0, sizeof ( INVERTEDTEXTDLGPARAMS ) ) ;
nRet = BitmapRegion.Initialize ();
if(nRet != SUCCESS)
return nRet;
DlgParams.uStructSize = sizeof ( INVERTEDTEXTDLGPARAMS ) ;
DlgParams.InvertedText.uStructSize = sizeof ( INVERTEDTEXT ) ;
DlgParams.InvertedText.pBitmapRegion = BitmapRegion.GetHandle ();
DlgParams.InvertedText.uBitmapStructSize = sizeof ( BITMAPHANDLE );
DlgParams.InvertedText.iMinInvertHeight = 1 ;
DlgParams.InvertedText.iMinInvertWidth = 1 ;
DlgParams.InvertedText.uFlags = INVERTEDTEXT_USE_DIAGONALS | INVERTEDTEXT_USE_DPI ;
DlgDocument.EnableCallBack (FALSE);
DlgDocument.EnablePreview(TRUE);
DlgDocument.EnableAutoProcess(TRUE);
DlgDocument.EnableToolbar(TRUE);
nRet = DlgDocument.SetInvertedTextParams(&DlgParams) ;
if(nRet != SUCCESS)
return nRet;
nRet = DlgDocument.DoModalInvertedText(hWnd);
if(nRet < 1)
return nRet;
if(BitmapRegion.HasRgn())
{
nRet = BitmapRegion.Region()->Free();
if(nRet != SUCCESS)
return nRet;
}
// Gets the updated values for the structure
nRet = DlgDocument.GetInvertedTextParams(&DlgParams, sizeof(DlgParams)) ;
if(nRet != SUCCESS)
return nRet;
nRet = LDialogDocument::Free();
if(nRet != SUCCESS)
return nRet;
return nRet;
}