[Gambas-user] Problem with Paint.Rectangle() and docu

Fabien Bodard gambas.fr at gmail.com
Thu Sep 27 16:11:31 CEST 2018


You need to use stroke insteed of fill

If you need to have a border with filld rect

First use the fill (true)
Then change brush
And finish with stroke

This will draw the back and then the border
Le jeu. 27 sept. 2018 15:45, Rolf-Werner Eilert <rwe-sse at osnanet.de> a
écrit :

> In the documentation to Paint.Rectangle there is
>
> This function is logically equivalent to:
> Paint.MoveTo(X, Y)
> Paint.LineTo(X + Width, Y)
> Paint.LineTo(X + Width, Y + Height)
> Paint.LineTo(X, Y + Height)
> Paint.ClosePath()
>
> The thing is, Paint.Rectangle will always fill the area, and I simply
> need a box (unfilled).
>
> The example from the documentation will not produce 4 lines and an empty
> space, but a filled rectangle as well.
>
> By the way, it does NOT play a roll if you use ClosePath or not. But if
> you forget Fill, there comes an error with Pending Path. So the example
> is a bit misleading here.
>
> And does Rectangle really have to produce a filled area? Is there no way
> to have a simple line drawn around?
>
> Regards
> Rolf
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180927/7a6194ab/attachment.html>


More information about the User mailing list