MImgDrawAligned

Functions ››
Parent Previous Next

bOk = MImgDrawAligned( hImage, hDC, nLeft, nTop, nRight, nBottom, nImgWid, nImgHt, nAlignFlags, nFlags )

Draws an image aligned in the specified device context.

Parameters
hImage
Number: Handle of the image

hDC
Number: Handle of the device context

nLeft, nTop, nRight, nBottom
Number: Rectangle to draw the image into

nImgWid, nImgHt
Number: Width / height of the image. Specify -1 to let M!Image determine the width / height.

nAlignFlags
Number: One horizontal and one vertical flag:

Horizontal flags

MIMG_ALIGN_LEFT

Left

MIMG_ALIGN_HCENTER

Centered

MIMG_ALIGN_RIGHT

Right

Vertical flags

MIMG_ALIGN_TOP

Top

MIMG_ALIGN_VCENTER

Centered

MIMG_ALIGN_BOTTOM

Bottom

nFlags
Number: Draw flags

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

Example
In this example an image is drawn centered into a window:
! Get the DC
Set hDC = GetDC( hWnd )
If hDC
 ! Get the image size
 Call MImgGetSize( hImage, nWidth, nHeight )
 ! Get the client rectangle of the window
 Call GetClientRect( hWnd, nLeft, nTop, nRight, nBottom )
 ! Draw it
 Set nAlignFlags = MIMG_ALIGN_HCENTER | MIMG_ALIGN_VCENTER
 Call MImgDrawAligned( hImage, hDC, nLeft, nTop, nRight, nBottom, nWidth, nHeight, nAlignFlags, 0 )
 ! Release the DC
 ReleaseDC( hWnd, hDC )


See also
MImgDraw
MImgDrawPattern
MImgSetDrawClipRect
MImgSetDrawState

Created with the Personal Edition of HelpNDoc: Easily create EBooks