MImgCtlSetFitMode

The M!Image Custom Control ›› Functions ››
Parent Previous Next

bOk = MImgCtlSetFitMode( hWndCtl, nMode )
bOk = CMImgCtl.SetFitMode( nMode )

Sets an image control's fit mode.

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

nMode
Number: The fit mode. Specify one of the following constants:

MIMG_FIT_NONE

The image is displayed with it's original size

MIMG_FIT_NORMAL

The image is stretched to the size of the control

MIMG_FIT_BEST

The image is stretched to the max. possible size keeping the aspect ratio

MIMG_FIT_WIDTH

The image is stretched to the width of the control, the height is set according to the aspect ratio

MIMG_FIT_HEIGHT

The image is stretched to the height of the control, the width is set according to the aspect ratio

Return
Boolean: TRUE if successful or FALSE if an error occurs

Example
In this example the fit mode is set to "best":

Set bOk = MImgCtlSetFitMode( hWndCtl, MIMG_FIT_BEST )

See also
MImgCtlGetFitMode

Created with the Personal Edition of HelpNDoc: Easily create CHM Help documents