A color-gradient, image, or bitmap background
PtWidget --> PtBasic --> PtContainer --> PtPane --> PtBkgd
For more information, see the diagram of the widget hierarchy.
<photon/PtBkgd.h>
The PtBkgd widget provides various background layouts.
A background image.
You can choose from the following background types:
Resource | C type | Pt type | Default |
---|---|---|---|
Pt_ARG_BKGD_BRT_FROM | ushort_t | Scalar | 0 |
Pt_ARG_BKGD_BRT_TO | ushort_t | Scalar | 255 |
Pt_ARG_BKGD_HUE_FROM | ushort_t | Scalar | 0 |
Pt_ARG_BKGD_HUE_TO | ushort_t | Scalar | 44000 |
Pt_ARG_BKGD_IMAGE | PhImage_t * | Alloc | NULL |
Pt_ARG_BKGD_MIX | ushort_t | Scalar | 1 |
Pt_ARG_BKGD_ORIENTATION | ushort_t | Scalar | Pt_BKGD_VERTICAL |
Pt_ARG_BKGD_PIXCOLORS | PgColor_t, short | Array | NULL |
Pt_ARG_BKGD_PIXMAP | char * | Alloc | NULL |
Pt_ARG_BKGD_PIX_HEIGHT | ushort_t | Scalar | 20 |
Pt_ARG_BKGD_PIX_WIDTH | ushort_t | Scalar | 20 |
Pt_ARG_BKGD_SAT_FROM | ushort_t | Scalar | 0 |
Pt_ARG_BKGD_SAT_TO | ushort_t | Scalar | 255 |
Pt_ARG_BKGD_SPACING | ushort_t | Scalar | 0 |
Pt_ARG_BKGD_STEPS | ushort_t | Scalar | 10 |
Pt_ARG_BKGD_TILE | ushort_t | Scalar | Pt_BKGD_GRID |
Pt_ARG_BKGD_TYPE | ushort_t | Scalar | Pt_BKGD_BRIGHTNESS |
C type | Pt type | Default |
---|---|---|
ushort_t | Scalar | 0 |
255 |
These define a brightness range using the standard HSB (hue/saturation/brightness) model. Values range from 0 to 255.
The HSB model is also known as the HSV (hue/saturation/value) model. For more information, see PgHSV(). |
C type | Pt type | Default |
---|---|---|
ushort_t | Scalar | 0 |
44000 |
These define a hue range using the standard HSB (hue/saturation/brightness) model. Values range from 0 to 65535. The hue determines the color background.
C type | Pt type | Default |
---|---|---|
PhImage_t * | Alloc | NULL |
This resource points to a PhImage_t structure that defines an image to be displayed. For more information, see PhImage_t, PgDrawImage() and PxLoadImage() in the Photon Library Reference.
Set the flags member of the PhImage_t structure to:
Ph_RELEASE_IMAGE | Ph_RELEASE_PALETTE | Ph_RELEASE_TRANSPARENCY_MASK | Ph_RELEASE_GHOST_BITMAP
before providing the image to the widget. If you do this, the memory used for the image is released when the widget is unrealized or destroyed.
Remember that this is an Alloc resource. When you set this resource, the widget copies the PhImage_t structure but not the data pointed to by the members of the structure. After setting this resource, you can free() the PhImage_t if you don't need it, but don't free() the members of it. |
C type | Pt type | Default |
---|---|---|
ushort_t | Scalar | 1 |
For the Pt_BKGD_HUE, Pt_BKGD_SATURATION, and Pt_BKGD_BRIGHTNESS background types. This resource determines whether or not color dithering is used in the gradient. By default, it's turned on.
C type | Pt type | Default |
---|---|---|
ushort_t | Scalar | Pt_BKGD_VERTICAL |
For the Pt_BKGD_HUE, Pt_BKGD_SATURATION, and Pt_BKGD_BRIGHTNESS background types. This resource sets the gradient orientation. By default the orientation is horizontal. Possible values:
C type | Pt type | Default |
---|---|---|
PgColor_t | Array | NULL |
For the Pt_BKGD_PIXMAP background type. An array of bitmap colors that correspond to the planes defined in Pt_ARG_BKGD_PIXMAP.
C type | Pt type | Default |
---|---|---|
char * | Alloc | NULL |
For the Pt_BKGD_PIXMAP background type. A sequence of planes provided in the format described in PgDrawBitmap().
C type | Pt type | Default |
---|---|---|
ushort_t | Scalar | 20 |
For the Pt_BKGD_PIXMAP background type. These resources indicate the height and width of the bitmap in pixels.
C type | Pt type | Default |
---|---|---|
ushort_t | Scalar | 0 |
255 |
These define a saturation range using the standard HSB (hue/saturation/brightness) model. Values range from 0 to 255. The saturation determines the amount of color to be used. A high value makes the color bright; a low one makes it look dim or gray.
C type | Pt type | Default |
---|---|---|
ushort_t | Scalar | 0 |
The spacing, in pixels, between tiles.
C type | Pt type | Default |
---|---|---|
ushort_t | Scalar | 10 |
For the Pt_BKGD_HUE, Pt_BKGD_SATURATION, and Pt_BKGD_BRIGHTNESS background types. This resource determines the number of steps used in the gradient to get from the minimum to the maximum value.
C type | Pt type | Default |
---|---|---|
ushort_t | Scalar | Pt_BKGD_GRID |
For the Pt_BKGD_PIXMAP and Pt_BKGD_IMAGE background types. This resource determines which type of tiling will be used to display the image. Possible values:
If you set this resource to zero, tiling will be disabled and the image will be drawn once at the top-left corner.
C type | Pt type | Default |
---|---|---|
ushort_t | Scalar | Pt_BKGD_BRIGHTNESS |
Determines which type of background will be displayed. Possible values:
In general, you specify the range of values for the background type you choose and enter only the "to" value for the other resources. So, for example, if you chose Pt_BKGD_HUE, you would enter both the "to" and "from" values for Pt_BKGD_HUE but only the "to" values for Pt_BKGD_SATURATION and Pt_BKGD_BRIGHTNESS.
The smoothness of the gradient is determined by Pt_ARG_BKGD_STEPS and Pt_ARG_BKGD_MIX.
You can use the Pt_BKGD_PIXMAP type for small pictures drawn by hand where you need the background fill color to show through. If you select this type, the widget uses the Pt_ARG_BKGD_PIXMAP resource.
You use the Pt_BKGD_IMAGE type primarily to display images imported from other sources. If you select this type, the widget uses the Pt_ARG_BKGD_IMAGE resource.
If the widget modifies an inherited resource, the "Default override" column indicates the new value. This modification affects any subclasses of the widget.