Unfortunately, painting is a headache in this programming language, and especially if you want to use 32-bit color. :/
First you have to make absolutely sure the shape is closed. If not the painting would take over the whole screen or, less often, other screen elements that could ruin your landscape or portrait.
It's better to forget about "P" command for DRAW for 32-bit color because it's confusing, "C" already requires specific LONG integer values and otherwise this programming system is very good yelling "Illegal function call" back at you if it doesn't like a value. You have the border color already in a variable called "colr". Assuming the color you want to paint with is called "paintcolr" then the code could be added like this:
The POINT TO SELECT TO PAINT is very important. I had to deduce it from your code which seems to draw an octagon and begins from the top-left corner. Figuring out the point inside the closed figure to paint is a science in itself in BASIC graphics programming.
I suppose you could use STR$() to force the _RGB() values that you want for "P" command for DRAW but using PAINT is more concise. Otherwise would have to use POINT(0) and POINT(1) to obtain the X,Y coordinates of the DRAW "pen" but it's not reliable. Irritatingly the Wiki page on POINT() says nothing about DRAW.
This is a quick silly program that I wrote demonstrating POINT(0) and POINT(1):
It is verified the first X,Y coordinates shown is the middle of the screen.
First you have to make absolutely sure the shape is closed. If not the painting would take over the whole screen or, less often, other screen elements that could ruin your landscape or portrait.
It's better to forget about "P" command for DRAW for 32-bit color because it's confusing, "C" already requires specific LONG integer values and otherwise this programming system is very good yelling "Illegal function call" back at you if it doesn't like a value. You have the border color already in a variable called "colr". Assuming the color you want to paint with is called "paintcolr" then the code could be added like this:
Code: (Select All)
DIM paintcolr AS LONG
paintcolr = _RGB(255, 0, 0)
PAINT(501, 301), paintcolr, colr
The POINT TO SELECT TO PAINT is very important. I had to deduce it from your code which seems to draw an octagon and begins from the top-left corner. Figuring out the point inside the closed figure to paint is a science in itself in BASIC graphics programming.
I suppose you could use STR$() to force the _RGB() values that you want for "P" command for DRAW but using PAINT is more concise. Otherwise would have to use POINT(0) and POINT(1) to obtain the X,Y coordinates of the DRAW "pen" but it's not reliable. Irritatingly the Wiki page on POINT() says nothing about DRAW.
This is a quick silly program that I wrote demonstrating POINT(0) and POINT(1):
Code: (Select All)
SCREEN 12
LOCATE 1, 1
PRINT POINT(0), POINT(1)
DRAW "s16fbdbrdhdbehebddhfbdhrbebuh"
LOCATE 2, 1
PRINT POINT(0), POINT(1)
END
It is verified the first X,Y coordinates shown is the middle of the screen.