Rapid-Q Documentation by William Yu (c)1999-2000 Appendix A: QIMAGELIST


QIMAGELIST Компонент

QImageList is an array of images, all of the same/fixed size.

QImageList Свойства
ПолеТипR/WПо умолчанию




BkColorINTEGERRWclNone
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.
BlendColorINTEGERRWclNone
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.
CountINTEGERR
Count returns the number of images in the imagelist.
DrawingStyleINTEGERRWdsNormal
DrawingStyle specifies the style to be used when the imagelist is drawing an image.
0 = dsFocused -- Рисует the image blending 25% with the system highlight color. This only affects imagelists which contain masks.
1 = dsSelected -- Рисует the image blending 50% with the system highlight color. This only affects imagelists which contain masks.
2 = dsNormal -- Рисует 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 -- Рисует using the mask regardless of the BkColor setting.
GetBMPARRAY of IMAGES/BMPR
GetBMP returns the image specified by their index.
Примерs:
DIM ImageList AS QIMAGELIST
DIM Button AS QBUTTON

ImageList.AddBMPFile("whatever.bmp", 0)
Button.BMP = Imagelist.GetBMP(0)
GetICOARRAY of IMAGES/ICOR
HandleINTEGERRW
HeightINTEGERRW
ImageTypeINTEGERRWitImage
ImageType determines whether the imagelist will use the image or the associated image mask when drawing.
MaskedINTEGERRWTrue
Masked specifies whether the imagelist contains transparent or non-transparent images.
WidthINTEGERRW

QImageList Методы
МетодТипОписаниеПараметры




AddBMPFileSUB (FileName$, MaskColor%)Add BMP file to Imagelist2
AddICOFileSUB (FileName$)Add Icon file to Imagelist1
AddBMPHandleSUB (BMP_Resource, MaskColor%)Add BMP to Imagelist2
AddICOHandleSUB (ICO_Resource)Add Icon to Imagelist1
ClearSUBRemoves all images0
DeleteSUB (Index%)Delete image at Index%1
DrawSUB (QIMAGE/QBITMAP/QCANVAS/QDXSCREEN, X%, Y%, Index%)Draw on canvas at (X,Y) with image index% in ImageList4
InsertBMPFileSUB (Index%, Filename$, Mask%)Insert BMP file at Index%3
InsertICOFileSUB (Index%, Filename$)Insert Icon file at Index%2
InsertBMPHandleSUB (Index%, BMP_Resource, Mask%)Insert BMP at Index%3
InsertICOHandleSUB (Index%, ICO_Resource)Insert Icon at Index%2


QImageList Примеры
' 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

Предыдущий Компонент Содержание Следующий Компонент