Difference between revisions of "Graphics.FillRectangle"

From Xojo Documentation

(Created page with "N/A")
 
Line 1: Line 1:
N/A
+
{{MethodBox
 +
| name=FillRectangle
 +
| owner=[[Graphics]]
 +
| ownertype=class
 +
| scope=public
 +
| parameters=x As [[Double]], y As [[Double]], width As [[Double]], height As [[Double]]
 +
| platform=all
 +
}}
 +
{{Description
 +
|text = Draws a rectangle filled with the current color. The current color is set with the DrawingColor property. }}
 +
 
 +
== Notes ==
 +
''X'' and ''Y'' are the coordinates of the top-left corner. ''Width'' and ''Height'' specify the size of the rectangle.
 +
 
 +
== Sample Code ==
 +
This example (in the [[Canvas.Paint|Paint]] event of a [[Canvas]] control) draws a rectangle with a red interior.
 +
<rbcode>
 +
g.DrawingColor = &cff0000 // Red
 +
g.FillRectangle(10, 10, 100, 60)
 +
</rbcode>

Revision as of 23:19, 4 June 2019

Method

Graphics.FillRectangle(x As Double, y As Double, width As Double, height As Double)

Supported for all project types and targets.

Draws a rectangle filled with the current color. The current color is set with the DrawingColor property.

Notes

X and Y are the coordinates of the top-left corner. Width and Height specify the size of the rectangle.

Sample Code

This example (in the Paint event of a Canvas control) draws a rectangle with a red interior.

g.DrawingColor = &cff0000 // Red
g.FillRectangle(10, 10, 100, 60)