bOk = MImgCtlSetScale( hWndCtl, nWhat, nScale )
bOk = CMImgCtl.SetScale( nWhat, nScale )

Sets an image control's image scale.

Parameters
hWndCtl
Window Handle: Window Handle of the image control.

nWhat
Number: The scale you want to set. Specify MIMG_SCALE_HORIZONTAL to modify the width, MIMG_SCALE_VERTICAL to modify the height or MIMG_SCALE_BOTH to modify both.

nScale
Number: The scale factor. 1 = original size, < 1 = smaller, > 1 = bigger.

Return
Boolean: TRUE if successful or FALSE if an error occured.

Example
In this example the horizontal scale is set so that the width of the image is 50% of the original width:

Set bOk = MImgCtlSetScale( hWndCtl, MIMG_SCALE_HORIZONTAL, 0.5 )

Remarks
If the fit mode MIMG_FIT_NORMAL or MIMG_FIT_BEST is set, the scale factors set with this function are ignored.

See also
MImgCtlGetScale
MImgCtlSetFitMode

Created with the Personal Edition of HelpNDoc: Full-featured Help generator