Hide

SftDirectory 3.5 - ActiveX File/Folder Control

Display
Print

SftDirectoryFolder.GetImage Method

Retrieves the file/folder's image.

Syntax

VB.NETobject.GetImage()
VBobject.GetImage
C#.NETvoid object.GetImage();
VC++HRESULT object->GetImage();
CHRESULT object->raw_GetImage();

object

A SftDirectoryFolder object.

Comments

The GetImage method retrieves the file/folder's image.

The GetImage method starts an asynchronous task which retrieves a folder's thumbnail image. Once the image is available, the FolderImageReady event occurs.

Examples

VB.NET

Private Sub AxSftDirectory1_SelectionFinal(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxSftDirectory1.SelectionFinal
    If Not AxSftDirectory1.CurrentFolder Is Nothing Then
        AxSftDirectory1.CurrentFolder.GetImage()
        LabelInfoTip.Text = AxSftDirectory1.CurrentFolder.InfoTip
    Else
        PictureBox1.Image = Nothing
        LabelInfoTip.Text = ""
    End If
End Sub

Private Sub AxSftDirectory1_FolderImageReady(ByVal sender As Object, ByVal e As AxSftDirectoryLib30._ISftDirectoryEvents_FolderImageReadyEvent) Handles AxSftDirectory1.FolderImageReady
    PictureBox1.Image = OLECvt.ToImage(e.picture)
End Sub

Private Sub CloseButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CloseButton.Click
    Application.Exit()

VB6

Private Sub CloseButton_Click()
    Unload Form1
End Sub

Private Sub SftDirectory1_SelectionFinal()
    If Not SftDirectory1.CurrentFolder Is Nothing Then
        SftDirectory1.CurrentFolder.GetImage
        InfoTipLabel.Caption = SftDirectory1.CurrentFolder.InfoTip
    Else
        Set Picture1.Picture = Nothing
        InfoTipLabel.Caption = ""
    End If
End Sub

Private Sub SftDirectory1_FolderImageReady(ByVal Folder As SftDirectoryLib30.ISftDirectoryFolder, ByVal Picture As stdole.IPictureDisp)
    Set Picture1.Picture = Picture

C#

private void axSftDirectory1_SelectionFinal(object sender, System.EventArgs e) {
    if (axSftDirectory1.CurrentFolder != null) {
        axSftDirectory1.CurrentFolder.GetImage();
        labelInfoTip.Text = axSftDirectory1.CurrentFolder.InfoTip;
    } else {
        pictureBox1.Image = null;
        labelInfoTip.Text = "";
    }
}

private void axSftDirectory1_FolderImageReady(object sender, AxSftDirectoryLib30._ISftDirectoryEvents_FolderImageReadyEvent e) {
    pictureBox1.Image = OLECvt.ToImage(e.picture);
}

private void closeButton_Click(object sender, System.EventArgs e) {
    Application.Exit();

C++

    return (HCURSOR) m_hIcon;
}

void CFullTreeViewDlg::OnSelectionFinal_SftDirectory1()
{
    ISftDirectoryPtr vDir1 = m_Dir1.GetControlUnknown();
    ISftDirectoryFolderPtr currFolder = vDir1->CurrentFolder;
    if (currFolder != NULL) {
        currFolder->GetImage();
        m_InfoTipCtrl.SetWindowText(currFolder->InfoTip);
    } else {
        m_InfoTipCtrl.SetWindowText(_T(""));
    }
}

void CFullTreeViewDlg::OnFolderImageReady_SftDirectory1(LPDISPATCH Folder, LPDISPATCH Picture)

See Also SftDirectoryFolder Object | Object Hierarchy


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