LDialogImageEffect::DoModalSwirl

Summary

Displays the Swirl dialog box, and gets the options for LBitmap::Swirl.

Syntax

#include "ltwrappr.h"

virtual L_INT LDialogImageEffect::DoModalSwirl(hWndOwner)

Parameters

HWND hWndOwner

Handle of the window which owns the dialog.

Returns

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.

Comments

LDialogImageEffect::SetSwirlParams must be called before using this function to set the initial values for the dialog. You can get the updated SWIRLDLGPARAMS with the values entered by the user through the dialog by using LDialogImageEffect::GetSwirlParams.

The Swirl dialog.

This dialog has the following fields:

The following are the fields in the Swirl Effect dialog:

image\BeforeAfterZoomToFit.gif
**Zoom to fit**

Use this button to fit entire preview images on both the Before and After views.

image\BeforeAfterZoomToNormal.gif
**Zoom to Normal**

Use this button to view images with normal scale on both the Before and After views.

Before View

This view shows the original image before the dialog applies any changes to it.

The view can be dragged when it is not in Zoom to Fit zoom mode. Place the mouse cursor over the view window (the cursor will change to a hand), then click and drag.

After View

This view shows the original image with the dialog changes applied. This enables the user to see a preview of what the image should look like when the changes are applied.

The view can be dragged when it is not in Zoom to Fit zoom mode. Place the mouse cursor over the view window (the cursor will change to a hand), then click and drag.

Swirl Rotation Angle Section:

This section contains an edit box, with slider, and a check box for setting the angle to use when swirling the image. Use the edit box or the slider to set the angle of rotation. Check the Clockwise check box to rotate the image clockwise. Clear the check box to rotate the image counterclockwise.

image\Icon_Pivot.gif
**Pivot Section:**

This section contains two edit boxes and a display area for setting the pivot point. You can also set the pivot point by right clicking on the Before view. The Pivot point

image\Icon_Pivot.gif
appears on the point you just clicked.

X Edit box:

Use this to set the pivot's x-axis position in the image. Enter the value directly in the edit box or use the arrows to set the desired value.

Y Edit box:

Use this to set the pivot's y-axis position in the image. Enter the value directly in the edit box or use the arrows to set the desired value.

Cursor Pos (x,y)

Displays the mouse position with respect to the image.

Center Button:

Use the Center button to center the Before and After views with respect to

image\Icon_Pivot.gif
the pivot point position.

OK

Use the OK button to close the dialog and apply the changes.

Cancel

Use the Cancel button to close the dialog and discard the changes.

Progress Bar

image\BeforeAfterProgressBar.gif

Located at the bottom of the dialog, this progress bar shows the percentage of the current dialog operation that has been completed.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT LDialogImageEffect_DoModalSwirlExample(LBitmap * pBitmap, HWND hWnd) 
{ 
   L_INT nRet; 
 
   LDialogImageEffect DlgImageEffect; 
 
   nRet = LDialogImageEffect::Initialize(0); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   DlgImageEffect.SetBitmap(pBitmap); 
 
   SWIRLDLGPARAMS DlgParams;  
 
   memset ( &DlgParams, 0, sizeof ( SWIRLDLGPARAMS ) ); 
 
   DlgParams.uStructSize      = sizeof ( SWIRLDLGPARAMS ); 
 
   DlgImageEffect.EnableCallBack (FALSE); 
   DlgImageEffect.EnablePreview(TRUE); 
   DlgImageEffect.EnableAutoProcess(TRUE); 
   DlgImageEffect.EnableToolbar(TRUE); 
 
   nRet = DlgImageEffect.SetSwirlParams(&DlgParams); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = DlgImageEffect.DoModalSwirl(hWnd); 
   if(nRet < 1) 
      return nRet; 
 
   // Gets the updated values for the structure 
 
   nRet = DlgImageEffect.GetSwirlParams(&DlgParams, sizeof(DlgParams)); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = LDialogImageEffect::Free(); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 
Help Version 22.0.2023.2.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Common Dialog C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.