Appendix A: QIMAGELIST
Rapid-Q Documentation by William Yu (c)1999-2000 |
Appendix A: QIMAGELIST |
|
QIMAGELIST Component
QImageList is an array of images, all of the same/fixed size.
QImageList Properties
Field | Type | R/W | Default |
|
|
|
|
BkColor | INTEGER | RW | clNone |
| BkColor determines which background color to use when drawing an image.
Setting BkColor to clNone specifies no background color, ie. the image is drawn transparently.
Setting BkColor to clDefault specifies using the imagelists background color when drawing.
|
BlendColor | INTEGER | RW | clNone |
| BlendColor determines which foreground color to use when drawing an image.
Setting BlendColor to clNone specifies no blend color, while setting BlendColor to clDefault specifies
the system highlight color for the foreground.
|
Count | INTEGER | R | |
| Count returns the number of images in the imagelist.
|
DrawingStyle | INTEGER | RW | dsNormal |
| DrawingStyle specifies the style to be used when the imagelist is drawing an image.
0 = dsFocused -- Draws the image blending 25% with the system highlight color. This only affects imagelists which contain masks.
1 = dsSelected -- Draws the image blending 50% with the system highlight color. This only affects imagelists which contain masks.
2 = dsNormal -- Draws the image using the color specified in the BkColor property. If the BkColor is clNone then the image is drawn transparently using the mask.
3 = dsTransparent -- Draws using the mask regardless of the BkColor setting.
|
GetBMP | ARRAY of IMAGES/BMP | R | |
| GetBMP returns the image specified by their index.
Examples:
DIM ImageList AS QIMAGELIST
DIM Button AS QBUTTON
ImageList.AddBMPFile("whatever.bmp", 0)
Button.BMP = Imagelist.GetBMP(0)
|
GetICO | ARRAY of IMAGES/ICO | R | |
Handle | INTEGER | RW | |
Height | INTEGER | RW | |
ImageType | INTEGER | RW | itImage |
| ImageType determines whether the imagelist will use the image or the associated image mask when drawing.
|
Masked | INTEGER | RW | True |
| Masked specifies whether the imagelist contains transparent or non-transparent images.
|
Width | INTEGER | RW | |
QImageList Methods
Method | Type | Description | Params |
|
|
|
|
AddBMPFile | SUB (FileName$, MaskColor%) | Add BMP file to Imagelist | 2 |
AddICOFile | SUB (FileName$) | Add Icon file to Imagelist | 1 |
AddBMPHandle | SUB (BMP_Resource, MaskColor%) | Add BMP to Imagelist | 2 |
AddICOHandle | SUB (ICO_Resource) | Add Icon to Imagelist | 1 |
Clear | SUB | Removes all images | 0 |
Delete | SUB (Index%) | Delete image at Index% | 1 |
Draw | SUB (QIMAGE/QBITMAP/QCANVAS/QDXSCREEN, X%, Y%, Index%) | Draw on canvas at (X,Y) with image index% in ImageList | 4 |
InsertBMPFile | SUB (Index%, Filename$, Mask%) | Insert BMP file at Index% | 3 |
InsertICOFile | SUB (Index%, Filename$) | Insert Icon file at Index% | 2 |
InsertBMPHandle | SUB (Index%, BMP_Resource, Mask%) | Insert BMP at Index% | 3 |
InsertICOHandle | SUB (Index%, ICO_Resource) | Insert Icon at Index% | 2 |
QImageList Examples
' Imagelist demo
$resource bmp_handle as "nolight.bmp"
$resource ico_handle as "close.ico"
DIM ImageList AS QImageList
DIM Form AS QForm
DIM Button AS QButton
ImageList.Width = 9
ImageList.Height = 17
ImageList.AddBMPHandle bmp_handle,0
'ImageList.AddBMPFile "nolight.bmp", 0
ImageList.AddICOHandle ico_handle
'ImageList.AddICOFile "close.ico"
Button.Parent = Form
Button.BMP = Imagelist.GetBMP(0)
Form.Icon = ImageList.GetICO(1)
Form.Showmodal
|
|