PictureControl

 

Contents

Name

PictureControl

Remark

The Picture class is used to paint a PictureHolder object in a control on dialog.

Hierarchy

Examples

EX1

#include <Origin.h>
#include <Dialog.h>

class PictureDialog : public Dialog
{
public:
    PictureDialog():Dialog(100, "OneStatic")
    {
    }
    
EVENTS_BEGIN
    ON_INIT(OnInitDialog)
EVENTS_END

    BOOL OnInitDialog()
    {
        Control ctrl = GetDlgItem(6000);
        PictureControl pc;
        pc.CreateControl(ctrl.GetSafeHwnd());
        PictureHolder pict;
        pict.Load("C:\\20by20.bmp");
        pc.SetPicture(pict);
        return TRUE;
        
    }

    int MyDoModal()
    {
        InitMsgMap();
        return Dialog::DoModal(NULL);
    }

};


void Launch()
{
    PictureDialog dlg;
    dlg.MyDoModal();
}

header to Include

Control.h

Reference

Members

Name Brief Example
CreateControl
PictureControl
SetBackgroundColor Sets the color of the picture background
SetBitMap Sets a picture from a HBITMAP to be displayed in the control Examples
SetBorderColor Sets the color of the picture border, ignored for DrawMode = PCDM_STRETCH_FILL
SetDIB Sets a picture from a HDIB to be displayed in the control Examples
SetEnhMetaFile Sets a picture from a HENHMETAFILE to be displayed in the control Examples
SetIcon Sets a picture from a HICON to be displayed in the control Examples
SetLeadBitmap Sets a picture from a LeadTools pBITMAPHANDLE to be displayed in the control Examples
SetMetaFile Sets a picture from a HMETAFILE to be displayed in the control Examples
SetPicture

Properties

Name Brief Example
DrawMode
KeepAspectRatio