CK_Object
|
+----CK_Component
|
+----CK_Primitive
|
+----CK_ScaledLabel
The CK_ScaledLabel displays an stretched
or shrunken bitmap. The bitmap is scaled to the size of the CK_ScaledLabel component.
When creating a scaled label, the CP_Width
and CP_Height must be explicitly set.
Note: At the moment, 8 bit-per-pixel
bitmaps cannot be scaled. This is the only restriction. All 16 or higher bit-per-pixel
bitmaps can be scaled, even if they are transparent or animated.
Properties
- CP_Bitmap
- The bitmap to be scaled to the component's width and height. The bitmap
can be either shrunken or enlarged.
- CP_BitmapRect
- Specifies a rectangular portion (CK_Rect) of the
CP_Bitmap to be used. Otherwise the entire bitmap is used. (v1.02)
- CP_CallbackArg1
- An integer value to be passed to the screen's componentCB method
when an event occurs in this component.
- CP_CallbackArg2
- Same as CP_CallbackArg1.
- CP_Cursor
- The cursor to be displayed when the mouse pointer is over the component.
(v1.02)
- CP_Height
- The height of the component. The bitmap is scaled to this height.
- CP_RelativeX
- Only used when this component is a child of a CK_BBoard or CK_ClipWindow.
It is the X position of the component relative to the parent's left edge.
- CP_RelativeY
- Only used when this component is a child of a CK_BBoard or CK_ClipWindow.
It is the Y position of the component relative to the parent's top edge.
- CP_Width
- The width of the component. The bitmap is scaled to this width.
- CP_X
- The absolute X-position, in screen coordinates, of the component. This can
only be set for the top-level component of a screen or a dialog.
- CP_Y
- The absolute Y-position, in screen coordinates, of the component. This can
only be set for the top-level component of a screen or a dialog.
- CP_ZOrder
- Used when this component is a child of a CK_BBoard. The CK_BBoard uses this
value to determine the order in which children are drawn. Smaller Z-order
values are drawn before larger Z-order values.
Example of creating a scaled
label:
extern CK_Bitmap *bitmap;
extern CK_Frame *frame;
CK_ScaledLabel *label1 = (CK_ScaledLabel *) CreateComponent(CT_ScaledLabel, frame,
CP_Bitmap, bitmap,
CP_Width, 200,
CP_Height, 200,
0);