BITMAP   [VDS6]

Top  Previous  Next

Syntax:

 

BITMAP COPY, <bitmap> {, <top>, <left>, <width>, <height> }

BITMAP DRAW, <bitmap>, CANVAS, <width>, <height>, <color>

BITMAP DRAW, <bitmap>, FILL, <x>, <y>, <color>

BITMAP DRAW,<bitmap>, LINE, <start x>, <start y>, <end x>, <end y>{,<color>, <width> {,INVERSE} {,DASH|DOT}}

BITMAP DRAW,<bitmap>, BOX, <start x>, <start y>, <end x>, <end y>{,<color>, <bgcolor>, <width> {,INVERSE|CLEAR} {,DASH|DOT}}

BITMAP DRAW, <bitmap>, ELLIPSE, <start x>, <start y>, <end x>, <end y>{, <color>, <bgcolor>, <width> {,INVERSE|CLEAR} {,DASH|DOT}}

BITMAP DRAW, <bitmap>, RBOX, <start x>, <start y>, <end x>, <end y>, <color>{, <color>, <bgcolor>, <width> {,INVERSE|CLEAR} {,DASH|DOT}}

BITMAP DRAW,<bitmap>, PIXEL, <x>, <y>, <color>

BITMAP DRAW, <bitmap>, TEXT, <x>, <y>, <text>{, <font>, <size>, <attributes>, <color>, <bgcolor>, CLEAR}

BITMAP LOAD, <bitmap>, <filename> {, <top>, <left>, <width>, <height> }

BITMAP PASTE, <bitmap> {, <top>, <left>, <width>, <height> }

BITMAP SAVE, <bitmap>, <filename> {, <top>, <left>, <width>, <height> }

 

Description:

 

The BITMAP command allows various operations to be performed on a BITMAP dialog element. It is important, when using this command, to understand the difference between the BITMAP dialog element and the bitmap image that it may contain. Although a BITMAP dialog element may exist and be a certain size, it contains no bitmap until a bitmap image (.bmp) file has been loaded, or a canvas has been prepared using BITMAP DRAW,...,CANVAS. The size of the bitmap need not be the same as the size of the dialog element.

Note: If an icon (.ico) file is loaded into a BITMAP dialog element, then a drawable bitmap is not created, and the BITMAP command and @BITMAP function cannot be used.

BITMAP COPY,...

This command copies the bitmap to the Windows clipboard. If the values <top>, <left>, <width> and <height> are specified, then the region defined by these values is copied to the clipboard.

BITMAP DRAW,...

This command allows various drawing operations to be performed on the surface of the bitmap. These operations are:

CANVAS

This command prepares a bitmap for drawing, creating a canvas of size <width> and <height> and filling it with <color>.

FILL

This command changes the pixel at <x>, <y> and all adjacent pixels of the same color with <color>

LINE

This command draws a line of width <width> and color <color> from <start x>, <start y> to <end x>, <end y>. If INVERSE is specified, the line color is combined with the background in such a way that it can be un-drawn by repeating the command. If DASH or DOT is specified then a dashed or dotted line is drawn.

BOX

This command draws a box (rectangle) of width <width> and outline color <color> from <start x>, <start y> to <end x>, <end y>. The box is filled with <bgcolor> or the last specified background color, unless CLEAR is specified, in which case the box is drawn transparent. If INVERSE is specified, the box is combined with the background in such a way that it can be un-drawn by repeating the command. If DASH or DOT is specified then a dashed or dotted outline is drawn.

ELLIPSE

This command draws an ellipse, in the same way as BOX above.

RBOX

This command draws an box with rounded corners, in the same way as BOX above.

PIXEL

This command sets the pixel at position <x>, <y> to the specified color.

TEXT

This command draws text on the bitmap, with the top left corner starting at <x>, <y>. If the font attributes, color and background color are specified then these are used, otherwise the defaults or the last specified text attributes are used. If CLEAR is specified then the background of the text is transparent. The font characteristics are specified in the same way as for a STYLE dialog element. The @BITMAP(TEXTSIZE) function may be used to determine the size of the area of text before it is written.

BITMAP LOAD,...

This command loads a bitmap file (.bmp) or resource into the specified bitmap dialog element. Unlike when DIALOG SET is used, the bitmap is not automatically resized to fit the file to be loaded. If <top> and <left> are specified, then the bitmap file is loaded at this offset within the bitmap. If <width> and <height> are specified then the bitmap file may be resized (stretched or shrunk) to fit the rectangle so defined.

BITMAP PASTE,...

This command pastes a bitmap image into the specified dialog element. The position and size of the bitmap may be defined in the same way as for BITMAP LOAD above. The @CLIPBRD function may be used to determine whether the clipboard contains a valid bitmap.

BITMAP SAVE,...

This command saves the contents of the bitmap to the specified file <filename>. If the values <top>, <left>, <width> and <height> are specified, then only the region defined by these values is saved.

 

OK:

 

Unchanged.

 

Example:

 

BITMAP DRAW,BITMAP1,CANVAS,40,40,SILVER

BITMAP DRAW,BITMAP1,LINE,0,0,40,40,BLACK

 

See also: