Graphic picture

picture = ole_ref

For use with GT_IMAGE only. Assigns or retrieves a reference (pointer) to an OLE object that contains a copy of the graphic image. This OLE picture object is the means used by OLE and ActiveX to pass images between OLE controls. The load_picture() function returns a pointer to an OLE picture object reference (ole_ref).

Like all OLE objects, the OLE picture object has properties and methods. The properties are:

Property

Type

Access

Description

HANDLE

i4

R

The Windows GDI handle of the picture

hPal

i4

RW

The Windows handle of the palette used by the picture

Type

i2

R

The type of picture. Types are defined in sculptor.h with prefix PICTYPE_.

Width

i4

R

The width of the picture in pixels

Height

i4

R

The height of the picture in pixels

KeepOriginalFormat

i1

RW

TRUE: The picture object maintains the entire original state of the picture in memory.

FALSE: Any state not applicable to the user’s machine is discarded.

Attributes

i4

R

Miscellaneous bit attributes of the picture (see below). Attribute values are defined in sculptor.h with prefix PICTURE_.

The properties can be referenced using the standard OLE property syntax:

ole_ref->”property_name

The HANDLE and hPal properties are not useful in Sculptor but could be passed to an OLE object capable of using them.

See Modifying or retrieving an OLE control property at run time.

A method for the OLE picture object can be called using the syntax:

ole_ref->”method_name”([arguments])


EXAMPLES

!temp image_ref,,o

image_ref = load_picture("SCULPTOR/images/picture1.bmp")

     if (image_ref->"Type" == PICTYPE_ICON) {
     Graphic1->picture = image_ref
     ...
     }

!temp sc_emobj,,i4

     +graphic IconOne at 11,1 {
          type = GT_IMAGE
          image = "$SCULPTOR/IMAGES/VISA.BMP"
          event = evIcon
     }

     sc_emobj = register_clipboard_string(CFSTR_EMBEDDEDOBJECT)

!function evIcon(EventCode, Object) {
!temp Result,,i4

     switch (EventCode) {
     case == EV_SELECT:
          Result = do_drag_drop(Object->picture, sc_emobj)
          ...
     }
if (check_clipboard(CF_BITMAP) == 0) {
     Graphic2->picture = get_clipboard(CF_BITMAP)
}
!temp sc_emobj,,i4

     +graphic IconOne at 11,1 {
          type = GT_IMAGE
          image = "$SCULPTOR/IMAGES/VISA.BMP"
          event = evIcon
     }

     sc_emobj = register_clipboard_string(CFSTR_EMBEDDEDOBJECT)

!function evIcon(EventCode, Object) {
!temp Result,,i4

     switch (EventCode) {
     case == EV_SELECT:
          Result = do_drag_drop(Object->picture, sc_emobj)
          ...
     }

RELATED TOPICS

Graphics

OLE controls

Modifying or retrieving an OLE control property at runtime

OLE control related definitions in sculptor.h

Object (o) type fields

load_picture()