SftButton/OCX 2.5

SftPictureObject.SetImage Method

Softel vdm, Inc.

Defines the picture object attributes defined as a GDI+ image.

Syntax       

VB.NET

object.SetImage(ByVal GDIPlusImage As Integer, ByVal Owned As Boolean)

VB

object.SetImage(ByVal GDIPlusImage As LONG_PTR, ByVal Owned As Boolean)

C#.NET

void object.SetImage(int GDIPlusImage, bool Owned);

VC++

HRESULT object->SetImage(LONG_PTR GDIPlusImage, VARIANT_BOOL Owned);

C

HRESULT object->raw_SetImage(LONG_PTR GDIPlusImage, VARIANT_BOOL Owned);

Delphi

procedure object.SetImage(GDIPlusImage : Pointer, Owned : WordBool);

object

A SftPictureObject object.

GDIPlusImage

A pointer to a Gdiplus::Image object.

Owned

Set to True if the GDI+ image is owned by the control, False otherwise.

Comments

The SetImage method defines the picture object attributes defined as a GDI+ image.

The SetImage property offers support for PNG, TIFF, JPEG, GIF, Exif, EMF+, EMF (GDI+ images) with full support for alpha-blended (translucent and semi-transparent) images.

If Owned is set to False, the image remains owned by the application and must remain valid as long as it is used by the control. Once it is no longer needed, it must be deleted by the application. Most languages, except C++, automatically delete the object when it is no longer needed so no action is usually necessary.

If Owned is set to True, the control automatically deletes the image object when it is no longer needed.

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

The Image property can also to define the image object using a GDI image, but it does not assign ownership of the GDI+ image to the control. SetImage(image, False) is identical to the use of the Image property.


Feedback / comments / error reports for this topic
© 2008 - Softel vdm, Inc. - www.softelvdm.com