The methods listed below deal with bitmaps.
>>-aBaseDialog~ChangeBitmapButton(--id--,--bmpNormal-----------------------> >--+--------------------------------------------------------------------+--> +-,bmpFocused--+---------------------------------------------------+-+ +-,bmpSelected--+---------------------------------+-+ +-,bmpDisabled--+---------------+-+ +-,styleOptions-+ >--)----------------------------------------------------------------------><
The ChangeBitmapButton method changes the bitmaps of a bitmap button.
The arguments are the same as for ConnectBitmapButton, except for the first argument (msgToRaise), which is skipped in this method.
The following example replaces the current bitmap with a new bitmap:
MyDialog~ChangeBitmapButton(501, "NewBB.bmp")
>>-aBaseDialog~GetBitmapSizeX(--id--)-------------------------><
The GetBitmapSizeX method returns the horizontal bitmap extension.
The only argument is:
The ID of the bitmap button
>>-aBaseDialog~GetBitmapSizeY(--id--)-------------------------><
The GetBitmapSizeY method returns the vertical bitmap extension.
The only argument is:
The ID of the bitmap button
>>-aBaseDialog~DrawBitmap(--+------+--,--id----------------------> +-hwnd-+ >--+----------------------------------------------------------+--> +-,--px--,--py--+----------------------------------------+-+ +-,--srcx--,--srcy--+------------------+-+ +-,--xlen--,--ylen-+ >--)------------------------------------------------------------><
The DrawBitmap method draws the bitmap of a button. You can also use this method to move a bitmap or a part of it.
The arguments are:
The handle to the window. If this argument is omitted, the handle for the button is used automatically.
The ID of the button that has the owner-draw option set
The upper-left corner of the target space within the button (default is 0)
The upper-left corner within the bitmap (default is 0)
The extension of the bitmap or a part of it (default is the whole bitmap)
>>-aBaseDialog~ScrollBitmapFromTo(--id--,--fromX--,--fromY--,--toX--,--toY--,--> >--stepX--,--stepY--,--delay--,--displace--)------------------><
The ScrollBitmapFromTo method scrolls a bitmap from one position to another within an owner-drawn button.
The arguments are:
The ID of the button
The starting position
The target position
The width of one step
The time in milliseconds this method waits after each move before doing the next move. This determines the speed at which the bitmap moves.
If set to 1 the internal position of the bitmap (bitmap displacement) is updated after each incremental move. DisplaceBitmap is called after each step to adjust the bitmap position. If the dialog is redrawn, the bitmap is shown at the correct position, but the drawing is slower.
>>-aBaseDialog~TiledBackgroundBitmap(--bmpFilename--)---------><
The TiledBackgroundBitmap method sets a bitmap as the background brush (Windows NT® only). If the bitmap size is less than the size of the background, the bitmap is drawn repetitively.
The only argument is:
The name of a bitmap file
>>-aBaseDialog~BackgroundBitmap(--bmpFilename-------------------> >--+-------------+--)------------------------------------------>< +-,--"USEPAL"-+
The BackgroundBitmap method sets a bitmap as the dialog's background picture.
The arguments are:
The name of a bitmap file
Set the last argument to USEPAL if you want to use the color palette of the bitmap. See ConnectBitmapButton for more information.
>>-aBaseDialog~DisplaceBitmap(--id--,--x--,--y--)-------------><
The DisplaceBitmap method sets the position of a bitmap within a button.
The arguments are:
The ID of a button
The horizontal displacement in screen pixels. A negative value can be used.
The vertical displacement (negative allowed)
The following example moves the bitmap within a button four screen pixels to the right and three pixels upward:
MyBaseDialog~DisplaceBitmap(244, 4, -3)
>>-aBaseDialog~GetBmpDisplacement(--id--)---------------------><
The GetBmpDisplacement method gets the position of a bitmap within a button.
The only argument is:
The ID of the button
The following example shows how to use the GetButtonRect and GetBmpDisplacement methods:
bRect = MyBaseDialog~GetButtonRect(244) parse var bRect left top right bottom bmpPos = MyBaseDialog~GetBmpDisplacement(244) parse var bmpPos x y