Reference » Window classes » MWindow » setFillSettings

Elgrint::MWindow::setFillSettings(MColor,MColor,double) method

Declaration (see MWindow.h):

void setFillSettings(const MColor& c1 = SameColor, const MColor& c2 = SameColor, double angle = Same);

Description

Configures solid or 2-color linear gradient filling for all subsequent filling functions.

Parameters:

Name Type Def value Description
c1 MColor SameColor

Starting gradient color or the solid color.

Details: If c1 is invalid, the previous value is preserved. Otherwise, c1 replaces the existing value. The initial value is determined by the BackColor property.

c2 MColor SameColor

Ending gradient color or invalid.

Details: If c2 is invalid, then it becomes equal to c1, i.e. the filling is solid (no gradient). Otherwise, c2 defines the second (ending) gradient color. The initial value is the same as that of c1 (i.e. there is no gradient by default)

angle double Same

Gradient direction in degrees from c1 to c2.

Details: If angle is invalid, then the existing value is preserved. Otherwise, angle determines the direction of the color gradient in degrees from the positive x-axis, increasing counter-clockwise. For example, if angle is 0 then a shape is filled with horizontal gradient, where the color gradually changes from c1 at the left edge to c2 at the right edge, and if angle is 45, then the color changes from c1 at the bottom-left corner to c2 at the top-right corner. The initial value is 0.

Remarks:

  • The angle parameter is obviously irrelevant if c1 and c2 are identical (i.e. no gradient)
  • The angle is not necessarily integral, although even a difference of a few degrees has no significant visible effect

Details

Specifies the parameters for the 2-color linear gradient, used by functions that fill two-dimensional areas: fillRect, fillArc, and 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.