c# - Arc based gradient -
I am trying to make an arc (variable width, variable number of the degree - potentially a whole cycle), which goes slowly, says, red on one end for green on the other. I do not know how to specify a gradient on an arch to accomplish this.
For example, if you can imagine creating a round temperature gauge where the degrees from 0 to 500 different from the gauge marker on the circle. In the form of an added view, I gauge the perimeter of the grid To indicate the temperature, I would like a gradient color - being very hot (red) from good (green).
I have tried both a footprint brush and LinerarGradientBrush (but maybe I missed something).
Thank you.
This code goes from red to green (left to right) will create an arc Comes to the form.
Private Zero Button 1_Click (Object Sender, EventArgs E) {Usage (Graphics G = this.CreateGraphics ()) {LinearGradientBrush lgb = new LinearGradientBrush (New Point (0, 0), New Point (210, 0), color. Color, color green); Pen p = new pen (LGB, 10); G. Drawerk (P, 10, 10, 200, 200, -22.5 F, -135F); }}
This will work up to 180 degrees for the arcs. I have to think about doing this for a full circle.