Hide

SftBox/OCX 5.0 - Combo Box Control

Display
Print

SftPictureObject.Picture Property

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 SftBox/OCX with ...".

Comments

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

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

Examples

VB.NET

        Dim itemIndex As Integer
        itemIndex = comboTarget.Items.Insert(e.data.GetData(SftOLEClipboardConstants.sftCFText), comboTarget.Items.DropIndex)
        comboTarget.Items.Selection = itemIndex
    End If
    If e.data.GetFormat(SftOLEClipboardConstants.sftCFBitmap) Then
        Dim itemIndex As Integer
        itemIndex = comboTarget.Items.Insert("A Bitmap", comboTarget.Items.DropIndex)
        Dim o As Object = e.data.GetData(SftOLEClipboardConstants.sftCFBitmap)
        comboTarget.get_Item(itemIndex).Image.Picture = o 'as stdole.IPictureDisp
        comboTarget.Items.Selection = itemIndex
    End If
    If e.data.GetFormat(SftOLEClipboardConstants.sftCFFiles) Then
        Dim itemIndex As Integer = -1
        Dim toIndex As Integer = comboTarget.Items.DropIndex
        Dim s As String
        For Each s In e.data.Files

VB6

Private Sub ComboTarget_OLEDragDrop(Data As SftBoxLib50.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
    Dim ItemIndex As Long
    If Data.GetFormat(sftCFText) Then
        ItemIndex = ComboTarget.Items.Insert(Data.GetData(sftCFText), ComboTarget.Items.DropIndex)
        ComboTarget.Items.Selection = ItemIndex
    End If
    If Data.GetFormat(sftCFDIB) Then
        ItemIndex = ComboTarget.Items.Insert("A Bitmap", ComboTarget.Items.DropIndex)
        Set ComboTarget.Item(ItemIndex).Image.Picture = Data.GetData(sftCFDIB)
        ComboTarget.Items.Selection = ItemIndex
    End If
    If Data.GetFormat(sftCFFiles) Then
        Dim vData As Variant, ToIndex As Long
        ToIndex = ComboTarget.Items.DropIndex
        For Each vData In Data.Files
            ItemIndex = ComboTarget.Items.Insert(vData, ToIndex)

C#

{
    if (e.data.GetFormat((short) SftOLEClipboardConstants.sftCFText)) {
        int itemIndex = comboTarget.Items.Insert(e.data.GetData(SftOLEClipboardConstants.sftCFText) as string, comboTarget.Items.DropIndex);
        comboTarget.Items.Selection = itemIndex;
    }
    if (e.data.GetFormat((short) SftOLEClipboardConstants.sftCFBitmap)) {
        int itemIndex = comboTarget.Items.Insert("A Bitmap", comboTarget.Items.DropIndex);
        object o = e.data.GetData(SftOLEClipboardConstants.sftCFBitmap);
        comboTarget.get_Item(itemIndex).Image.Picture = o as stdole.IPictureDisp;
        comboTarget.Items.Selection = itemIndex;
    }
    if (e.data.GetFormat((short) SftOLEClipboardConstants.sftCFFiles)) {
        int itemIndex = -1;
        int toIndex = comboTarget.Items.DropIndex;
        foreach (string s in e.data.Files) {
            itemIndex = comboTarget.Items.Insert(s, toIndex);

See Also SftPictureObject Object | Object Hierarchy


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