Older Newer
Sun, 26 Dec 2021 09:15:10 . . . . SyneRyder [Initial function definition]


Changes by last author:

Added:
= setRectangle =

== Syntax ==

bool setRectangle(int left, int top, int right, int bottom, int color)

== Arguments ==

:left

::top-left x co-ordinate of the rectangle, in pixels.

:top

::top-left y co-ordinate of the rectangle, in pixels.

:right

::bottom-right x co-ordinate of the rectangle, in pixels.

:bottom

::bottom-right y co-ordinate of the rectangle, in pixels.

:color

::Color value for the rectangle.

== Returns ==

True if the function succeeded, false otherwise

== Description ==

Draw a rectangle with the given color on an OWNERDRAW control.

== Example ==

<code>

%fml

ctl(1): OWNERDRAW(drawitem), Pos=(300,50), Size=(100, 100)

OnFilterStart: {

// Maximum X/Y pixel co-ords of ownerdraw

int maxxpixel = HDBUsToPixels(100)-1;

int maxYpixel = VDBUsToPixels(100)-1;

// Start using setPixel drawing on OWNERDRAW control 1

startSetPixel(1);

setFill(COLOR(BLACK));

// Draw a yellow rectangle in OWNERDRAW area

setRectangle(20, 20, maxxpixel-20, maxYpixel-20, RGB(255,255,0));

// Stop using setPixel drawing

endSetPixel(1);

return true;

}

</code>

== See Also ==

OWNERDRAW, startSetPixel, setEllipse, setEllipseFill, setRectFill, setRectGradient, endSetPixel