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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Dynamic FillStyle changing

Thread ID:





43525 Apr 25,2006 02:41 PM UTC May 5,2006 07:03 AM UTC WinForms 2
Tags: Diagram
Johann Schraml
Asked On April 25, 2006 02:41 PM UTC

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


Administrator [Syncfusion]
Replied On 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.

Johann Schraml
Replied On 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


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon