Compartilhar via


CDialogEx::SetBackgroundImage

Sets the background image of the dialog box.

void SetBackgroundImage(
   HBITMAP hBitmap,
   BackgroundLocation location=BACKGR_TILE,
   BOOL bAutoDestroy=TRUE,
   BOOL bRepaint=TRUE 
);
BOOL SetBackgroundImage(
   UINT uiBmpResId,
   BackgroundLocation location=BACKGR_TILE,
   BOOL bRepaint=TRUE 
);

Parameters

  • [in] hBitmap
    A handle to the background image.

  • [in] uiBmpResId
    The resource ID of the background image.

  • [in] location
    One of the CDialogEx::BackgroundLocation values that specify the location of the image. Valid values include BACKGR_TILE, BACKGR_TOPLEFT, BACKGR_TOPRIGHT, BACKGR_BOTTOMLEFT, and BACKGR_BOTTOMRIGHT. The default value is BACKGR_TILE.

  • [in] bAutoDestroy
    TRUE to automatically destroy the background image; otherwise, FALSE.

  • [in] bRepaint
    TRUE to immediately redraw the dialog box; otherwise, FALSE.

Return Value

In the second method overload syntax, TRUE if the method is successful; otherwise, FALSE.

Remarks

The image that you specify is not stretched to fit the dialog box client area.

Requirements

Header: afxdialogex.h

See Also

Reference

CDialogEx Class

Hierarchy Chart