We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Dynamic FillStyle changing

Hi, I have to change programmatically the FillStyle of any Symbol so that the filling grows in percent of the Symbol bounds (take a look at the static example I added). Thereby the filling mechanism should act in any direction (south -> north; n->s; w->e;e->w). In addition to that it would be great if I could set a color gradient on the margin of the current fill height and the width of the color gradient. How do I get this started? Many thanks in advance, Uli

DynamicFillStyle.zip

2 Replies

AD Administrator Syncfusion Team May 3, 2006 01:31 PM UTC

Hi Uli, My apologies for the delay in getting back to you. The way to go about this would be by sub classing the FilledShape class and overriding the Draw() method with the suitable implementation. The Draw() in the FilledShape class is used to fill the interior of a shape Node. The FilledShape. Draw() method calls the CreateBrush( Graphics grfx,RectangleF fillBounds ) method which is used to fill the region to the amount specified by the fillBounds. And hence providing the desired value to the fillbounds will let you fill the color to the specified value. I hope this information will help you and let me know if you have any further queries. Regards, Praveena.


JS Johann Schraml May 5, 2006 07:03 AM UTC

Hi Praveena, thanks again for your help. To get the filling running as expected I have to: fillBounds.Height = x; fillBounds.Width = x; Region reg = new Region(clonePath); reg.Exclude(fillBounds); grfx.FillRegion(brush, reg); greetz, Uli

Loader.
Live Chat Icon For mobile
Up arrow icon