Hide

SftButton/OCX 3.0 - Button Control

Display
Print

Picture Property, SftPictureObject Object

Defines the image object using an OLE Picture object (IPictureDisp interface).

Syntax

Get

VB.NETpPictureDisp = object.Picture As stdole.IPictureDisp
VBSet pPictureDisp = object.Picture As IPictureDisp
C#.NETstdole.IPictureDisp pPictureDisp = object.Picture;
VC++IPictureDisp* pPictureDisp = object->GetPicture();
CHRESULT object->get_Picture(IPictureDisp** pPictureDisp);

Put

VB.NETobject.let_Picture(ByVal pPictureDisp As stdole.IPictureDisp)
VBobject.Picture = pPictureDisp As IPictureDisp
C#.NETvoid object.let_Picture(stdole.IPictureDisp pPictureDisp);
VC++void object->PutPicture(IPictureDisp* pPictureDisp);
CHRESULT object->put_Picture(IPictureDisp* pPictureDisp);

PutRef

VB.NETobject.Picture = pPictureDisp As stdole.IPictureDisp
VBSet object.Picture = pPictureDisp As IPictureDisp
C#.NETstdole.IPictureDisp object.Picture = pPictureDisp;
VC++void object->PutRefPicture(IPictureDisp* pPictureDisp);
CHRESULT object->putref_Picture(IPictureDisp* pPictureDisp);

object

A SftPictureObject object.

pPictureDisp

Defines the image object using an OLE Picture object (IPictureDisp interface). For information about picture properties, please visit the applicable section "Using SftButton/OCX with ...".

Comments

The Picture property defines the image object using an OLE Picture object (IPictureDisp interface).

Typically, .NET applications use the NETImageObject property to define an image, C and C++ applications use BitmapHandle or Image, VB6 and other COM applications use the Picture property.

The SftPictureObject.Type property is set to sftTypeIDispatch. The SftPictureObject.ActualHeight and SftPictureObject.ActualWidth properties reflect the image size.

Examples

VB6

Private Sub CloseButton_Click()
    End
End Sub

Private Sub Form_Load()
    With SftButton2
        ' you could set these at design time using the property pages
        Set .Image1Pressed.Picture = PictureOn.Picture
        Set .Image1.Picture = PictureOff.Picture
    End With
End Sub

Private Sub ChangePicture_SftButton3()
    ' Change the pictures based on the button's Pressed status
    With SftButton3
        If .Pressed Then

C++

    if (FAILED(hr)) return;

    IPictureDispPtr pPicDisp = pPic;

    ISftPictureObjectPtr pImg1;
    hr = m_vButton3->get_Image1(&pImg1);
    ASSERT(SUCCEEDED(hr));

    hr = pImg1->put_Picture(pPicDisp);
    ASSERT(SUCCEEDED(hr));

    bmp.DeleteObject();
    pPic = NULL;

    if (m_vButton3->Pressed)
        bmp.LoadBitmap(IDB_OFF);

See Also SftPictureObject Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.