HeaderPane
Main
Hide

SftTree/OCX 8.0 - ActiveX Tree Control

Share Link
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 SftTree/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

VB.NET

            AxSftTree1.get_Item(ItemIndex).LabelImage = Img
            AxSftTree1.get_Item(ItemIndex).RowHeader.Image = Img
        End If
    End Sub

    Private Sub UpdatePictures(ByVal ItemIndex As Integer, ByVal IPic As stdole.IPictureDisp, ByVal Align As SftTreeHAlignConstants)
        Dim C As SftTreeCell
        C = AxSftTree1.get_Cell(ItemIndex, 0)
        C.Image.Picture = IPic
        C.ImageHAlign = Align
        PropagateImage(ItemIndex, C.Image)
    End Sub

    Private Sub UpdateImages(ByVal ItemIndex As Integer, ByVal Img As Image, ByVal Align As SftTreeHAlignConstants)
        Dim C As SftTreeCell
        C = AxSftTree1.get_Cell(ItemIndex, 0)

VB6

         DisabledItemsSelectable=   1
         AutoExpandDragDropInterval=   1200
         AutoExpandHoverInterval=   1200
         ToolTipIntervalOn=   200
         ToolTipIntervalOff=   100
         BeginProperty ItemImageExpandable {980702E2-0AB6-41B1-9B85-F8755A697255} 
            Object.Height          =   0
            Object.Width           =   0
            Picture         =   "Form1.frx":07D6
            Appearance      =   -1
            FrameColor      =   -1
            SampleColor     =   -1
         EndProperty
         BeginProperty ItemImageExpanded {980702E2-0AB6-41B1-9B85-F8755A697255} 
            Object.Height          =   0
            Object.Width           =   0

C#

                axSftTree1.get_Item(ItemIndex).LabelImage = Img;
                axSftTree1.get_Item(ItemIndex).RowHeader.Image = Img;
            }
        }

        private void UpdatePictures(int ItemIndex, stdole.IPictureDisp IPic, SftTreeHAlignConstants Align)
        {
            SftTreeCell C = axSftTree1.get_Cell(ItemIndex, 0);
            C.Image.Picture = IPic;
            C.ImageHAlign = Align;
            PropagateImage(ItemIndex, C.Image);
        }

        private void UpdateImages(int ItemIndex, Image img, SftTreeHAlignConstants Align)
        {
            SftTreeCell C = axSftTree1.get_Cell(ItemIndex, 0);

C++

    m_vTree->Cell[i][0]->ProgressColor = RGB(128,128,0);
    m_vTree->Cell[i][0]->ProgressColorEnd = RGB(255,255,0);
    m_vTree->Cell[i][0]->ProgressMax = 150;   // maximum value 0-150
    m_vTree->Cell[i][0]->ProgressValue = 40; // current value
    m_vTree->Cell[i][0]->BackColor = 0x80000000L | COLOR_WINDOW;
    m_vTree->Cell[i][0]->BackColorEnd = RGB(255, 0, 0);
    m_vTree->Cell[i][0]->BackColorOrientation = horizontalDefaultOrientationSftTree;

    ItemIndex = m_vTree->Items->Add("Supported Picture Types");

    m_vTree->Cell[ItemIndex][1]->Text = _T("SftTree/OCX supports numerous image types, such as GDI+, bitmaps, icons, ImageLists and also offers numerous built-in images.");

    // add GDI+ samples

    ItemIndex = m_vTree->Items->Add(_T("GDI+ Images"));
    m_vTree->Item[ItemIndex]->Level = 1;

See Also SftPictureObject Object | Object Hierarchy


Last Updated 05/24/2026 - (email)
© 2026 Softel vdm, Inc.