LDialogImage::DoModalCanvasResize
#include "ltwrappr.h"
virtual L_INT LDialogImage::DoModalCanvasResize(hWndOwner)
HWND hWndOwner; |
/* handle of the window which owns the dialog */ |
Displays the Canvas Resize dialog box.
Parameter |
Description |
hWndOwner |
Handle of the window which owns the dialog. |
Returns
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. |
Comments
LDialogImage::SetCanvasResizeParams must be called before using this function to set the initial values for the dialog. You can get the updated CANVASRESIZEDLGPARAMS with the values entered by the user through the dialog by using LDialogImage::GetCanvasResizeParams.
The Canvas Resize dialog is shown in the following figure:
Required DLLs and Libraries
LTDLGIMG For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application |
See Also
Example
void TestFunction(LBitmap * pBitmap, HWND hWnd)
{
LDialogImage DlgImage;
LDialogImage::Initialize(DLG_INIT_COLOR );
DlgImage.SetBitmap(pBitmap);
CANVASRESIZEDLGPARAMS DlgParams;
memset ( &DlgParams, 0, sizeof ( CANVASRESIZEDLGPARAMS ) ) ;
DlgParams.uStructSize = sizeof ( CANVASRESIZEDLGPARAMS ) ;
DlgParams.uDlgFlags = DLG_CANVASRESIZE_SHOW_CURRENT_HEIGHT |
DLG_CANVASRESIZE_SHOW_CURRENT_WIDTH |
DLG_CANVASRESIZE_SHOW_HORIZPOS |
DLG_CANVASRESIZE_SHOW_VERTZPOS |
DLG_CANVASRESIZE_SHOW_BACKCOLOR |
DLG_CANVASRESIZE_SHOW_KEEPASPECT ;
DlgParams.nCurrentWidth = pBitmap->GetWidth();
DlgParams.nCurrentHeight = pBitmap->GetHeight();
DlgParams.crBkgnd = RGB ( 255, 255, 255 ) ;
DlgImage.EnableCallBack(FALSE);
DlgImage.EnablePreview(TRUE);
DlgImage.EnableAutoProcess(TRUE);
DlgImage.EnableToolbar(TRUE);
DlgImage.SetCanvasResizeParams(&DlgParams) ;
DlgImage.DoModalCanvasResize(hWnd);
// Gets the updated values for the structure
DlgImage.GetCanvasResizeParams(&DlgParams, sizeof(DlgParams)) ;
LDialogImage::Free();
}