Displays the Ripple dialog box, and gets the options for LBitmap::Ripple.
#include "ltwrappr.h"
virtual L_INT LDialogImageEffect::DoModalRipple(hWndOwner)
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. |
LDialogImageEffect::SetRippleParams must be called before using this function to set the initial values for the dialog. You can get the updated RIPPLEDLGPARAMS with the values entered by the user through the dialog by using LDialogImageEffect::GetRippleParams.
This dialog has the following fields:
Use this button to fit entire preview images on both the Before and After views.
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.
Frequency Edit box:
Use this to set the number of repeated waves along the radial line. Enter the value directly in the edit box or use the arrows to set the desired value.
Phase Edit box:
Use this to set the wave phase shift. Enter the value directly in the edit box or use the arrows to set the desired value.
Amplitude Edit box:
Use this to set the wave magnitude. Enter the value directly in the edit box or use the arrows to set the desired value.
Attenuation Edit box:
Use this to set the attenuation value for the wave. The attenuation value indicates how rapidly the wave amplitude decays as the wave travels along the radial line. Enter the value directly in the edit box or use the arrows to set the desired value.
Exposed Area Section:
This area contains a drop-down list box and a button for specifying how to fill any exposed areas. The drop-down list box contains the following options:
Don't Change: Leave the exposed area as is, without changing it.
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
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
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
Located at the bottom of the dialog, this progress bar shows the percentage of the current dialog operation that has been completed.
L_INT LDialogImageEffect_DoModalRippleExample(LBitmap * pBitmap, HWND hWnd)
{
L_INT nRet;
LDialogImageEffect DlgImageEffect;
nRet = LDialogImageEffect::Initialize(DLG_INIT_COLOR );
if(nRet != SUCCESS)
return nRet;
DlgImageEffect.SetBitmap(pBitmap);
RIPPLEDLGPARAMS DlgParams;
memset ( &DlgParams, 0, sizeof ( RIPPLEDLGPARAMS ) );
DlgParams.uStructSize = sizeof ( RIPPLEDLGPARAMS );
DlgParams.uAmplitude = 100;
DlgParams.uFrequency = 50;
DlgImageEffect.EnableCallBack(FALSE);
DlgImageEffect.EnablePreview(TRUE);
DlgImageEffect.EnableAutoProcess(TRUE);
DlgImageEffect.EnableToolbar(TRUE);
nRet = DlgImageEffect.SetRippleParams(&DlgParams);
if(nRet != SUCCESS)
return nRet;
nRet = DlgImageEffect.DoModalRipple(hWnd);
if(nRet < 1)
return nRet;
// Gets the updated values for the structure
nRet = DlgImageEffect.GetRippleParams(&DlgParams, sizeof(DlgParams));
if(nRet != SUCCESS)
return nRet;
nRet = LDialogImageEffect::Free ();
if(nRet != SUCCESS)
return nRet;
return SUCCESS;
}