Warning: count(): Parameter must be an array or an object that implements Countable in /customers/5/2/b/winsoft.se/httpd.www/wp-includes/post-template.php on line 284

Drawing bars

To do bars, the Bar instruction is used. It takes the color, position and size as arguments. This code…

//Set image size and background color.
Clear 100x100 #003366

//Draw a dark blue bar that covers most of the image.
Bar #225599 X:10 Y:10 W:80 H:80

…produces this blue rectangle:

To do a bar that is only party filled; you can specify the percentage of the filling as an additional argument. In this example, I draw a white rectangle over the blue rectangle, on the exact same place as it. Also, I use the VFill argument to specify that the height will be only 75% of the full rectangle. This code…

//Set image size and background color.
Clear 100x100 #003366

//Draw a dark blue bar that covers most of the image.
Bar #225599 X:10 Y:10 W:80 H:80

//Draw a white bar on over the dark blue bar.
//Let it be a horizontal bar, 75% filled.
Bar #ffffff X:10 Y:10 W:80 H:80 VFill:75%

…produces this white bar over the blue rectangle:

The argument used for doing a bar that is partly filled horizontally, use HFill instead of VFill.

Leave a Reply

Your email address will not be published. Required fields are marked *