Reference » Window classes » MWindow » fillRect

Elgrint::MWindow::fillRect(MRect) method

Declaration (see MWindow.h):

void fillRect(const MRect& rect);


Fills rectangular shape bound by the specified rect (integral coordinates only).



Name Type Description
rect MRect

Position and size of the rectangle to fill (rounded out).

Details: If rect is invalid, nothing is drawn. Otherwise, rect is transformed according to the latest setDrawTransform and rounded out to the nearest integral rect.


  • MaxRect can be used to fill the entire window conveniently (regardless of any transformations). Note, however, that this makes sense only for solid fills, not gradients
  • The z and d components are reserved for the future support of 3D drawing


The filling parameters (e.g. colors) are specified by the preceding setFillSettings. The rect is rounded out to the nearest integral rect for efficiency and consistency with a window size (which is always integral). To paint a rect with non-integral coordinates use fillPoly.



Let us know

Please Contact us to report any errors on this page, or to suggest any improvements.

Miranor Home | About Miranor | About Elgrint | Create account | Login | Account settings | Contact Us | Privacy Policy | Site map

© Copyright 2014 by Miranor. All rights reserved. By using this site you agree to the Terms of Use.

Page last updated on August 10th, 2014.