Hide

SftButton/OCX 3.0 - Button Control

Display
Print

NETImageObject Property, SftPictureObject Object

Defines the image object using a .NET image object (IUnknown interface).

Syntax

Get

VB.NETpUnknown = object.NETImageObject As Object
VBpUnknown = object.NETImageObject As Unknown
C#.NETobject pUnknown = object.NETImageObject;
VC++IUnknown* pUnknown = object->NETImageObject;
IUnknown* pUnknown = object->GetNETImageObject();
CHRESULT object->get_NETImageObject(IUnknown** pUnknown);

PutRef

VB.NETobject.NETImageObject = pUnknown As Object
VBSet object.NETImageObject = pUnknown As Unknown
C#.NETobject object.NETImageObject = pUnknown;
VC++IUnknown* object->NETImageObject = pUnknown;
void object->PutRefNETImageObject(IUnknown* pUnknown);
CHRESULT object->putref_NETImageObject(IUnknown* pUnknown);

object

A SftPictureObject object.

pUnknown

Defines the image object using a .NET image object (IUnknown interface).

Comments

The NETImageObject property defines the image object using a .NET image object (IUnknown 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 sftTypeGDIPlus. The SftPictureObject.ActualHeight and SftPictureObject.ActualWidth properties reflect the image size.

Use of this property requires the SftHelperComponent component, which is added to each project (see "Using SftButton/OCX with .NET").

Examples

VB.NET

Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
    Application.Exit()
End Sub

Private Sub ChangePicture_Button3()
    ' Change the pictures based on the button's Pressed status
    If AxSftButton3.Pressed Then
        AxSftButton3.Image1.NETImageObject = ImageList1.Images(1)
        AxSftButton3.Image2.NETImageObject = ImageList1.Images(0)
    Else
        AxSftButton3.Image1.NETImageObject = ImageList1.Images(0)
        AxSftButton3.Image2.NETImageObject = ImageList1.Images(1)
    End If
End Sub

Private Sub axSftButton3_ClickEvent(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AxSftButton3.ClickEvent

C#

    Application.Exit();
}

private void ChangePicture_Button3()
{
    // Change the pictures based on the button's Pressed status
    if (axSftButton3.Pressed)
    {
        axSftButton3.Image1.NETImageObject = imageList1.Images[1];
        axSftButton3.Image2.NETImageObject = imageList1.Images[0];
    } else {
        axSftButton3.Image1.NETImageObject = imageList1.Images[0];
        axSftButton3.Image2.NETImageObject = imageList1.Images[1];
    }
}

See Also SftPictureObject Object | Object Hierarchy


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