Menu

Gradient fill in shapes

iwbnwif
2013-08-06
2013-08-08
  • iwbnwif

    iwbnwif - 2013-08-06

    I would like to fill a wxSF shape with a gradient, but I am not sure of the best way of doing this.

    1. Override the DrawNormal, DrawHover and DrawHighlighted methods

    or

    1. Somehow get the graphics context and create a gradient fill brush, presumably this will only work when EnableDC is true

    If anyone has any suggestions they would be warmly appreciated

     
  • Michal Bližňák

    Gradient fill for non-rectangle shapes is allowed when enhanced graphics (wxGraphicsContext) is used only. Basic rectangles can be filled with a gradinet even in classic drawing mode. In both cases, overriding of virtual methods responsible for shape's drawing (as you mentioned above) is recommended way.

     
  • iwbnwif

    iwbnwif - 2013-08-08

    Thank you for taking the time to answer this, its good to know I am on the right way.

     

Log in to post a comment.