devfzf
December 15, 2010, 6:41am
1
Hi Support!
I modified object, and I would like to know if is possible to paint all object, as you can see in code, I am using pen.CompoundArray , and this part was not painted.
mfirst_color = Color.FromArgb(159, 232, 0);
msecond_color = Color.White;
GoDrawing bkground_shape = new GoDrawing(GoFigure.Circle);
Pen pen = new Pen(Color.Black, 5);
pen.CompoundArray = new float[] { 0.0f, 0.2f, 0.8f, 1.0f };
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
bkground_shape.Pen = pen;
this.Background = bkground_shape;
this.Shape.FillShapeHighlight(first, second);
Jake
December 15, 2010, 8:51am
2
Well, I don’t see any solution to this. CompoundArray Pens have 1 color. If you really want the border filled, you’ll have to do it as 2 overlapped GoDrawing objects.
walter
December 15, 2010, 9:17am
3
Why not one GoDrawing consisting of two concentric circular figures?
devfzf
December 15, 2010, 10:02am
4
Hi Jake, I should use GoDrawing InsertShape ? See my code… What´s wrong ?
Thanks!
GoDrawing first_shape = new GoDrawing(GoFigure.Circle);
Pen pen = new Pen(Color.Black, 1);
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
first_shape.Pen = pen;
GoDrawing second_shape = new GoDrawing(GoFigure.Circle);
Pen pen2 = new Pen(Color.Black, 1);
pen2.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
second_shape.Pen = pen;
first_shape.InsertShape(0, second_shape);
//This is a GoTextNode
this.Background = bkground_shape;
public class CircleItem : GoTextNode
{
.
.
.
.
}
Jake
December 15, 2010, 10:08am
5
But you want the outside ring to be solid and the inside circle to be gradient, right? One GoDrawing, even with 2 shapes, is only going to give you one pen/brush.
devfzf
December 15, 2010, 10:24am
6
yes,I want the outside ring to be solid and the inside circle to be gradient… How can I do it?
Now I have just this code…and I don´t know how to add your example code. Can you help me, please?
mfirst_color = Color.FromArgb(159, 232, 0);
msecond_color = Color.White;
GoDrawing bkground_shape = new GoDrawing(GoFigure.Circle);
Pen pen = new Pen(Color.Black, 1);
pen.CompoundArray = new float[] { 0.0f, 0.2f, 0.8f, 1.0f };
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
bkground_shape.Pen = pen;
this.Background = bkground_shape;
this.Shape.FillShapeHighlight(first, second);
this.Shape.Size = new Size(50, 51);
Jake
December 15, 2010, 11:00am
7
You’ll need 2 GoDrawing objects to have 2 different brushes. You can combine them in a GoGroup, then use the GoGroup for the Background.
devfzf
December 15, 2010, 11:37am
8
Ok Jake, now I understood, and figure was good!! Thanks!!
GoDrawing first_shape = new GoDrawing(GoFigure.Circle);
Pen pen = new Pen(Color.Black, 1);
first_shape.Size = new Size(50, 51);
first_shape.FillShapeHighlight(first, second);
first_shape.Editable = false;
first_shape.Selectable = false;
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
first_shape.Pen = pen;
GoDrawing second_shape = new GoDrawing(GoFigure.Circle);
Pen pen2 = new Pen(Color.Black, 1);
second_shape.Size = new Size(40, 41);
second_shape.FillShapeHighlight(first, second);
second_shape.Editable = false;
second_shape.Selectable = false;
GoObject back = first_shape;
second_shape.SetSpotLocation(MiddleCenter, back, MiddleCenter);
pen2.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
second_shape.Pen = pen2;
GoGroup mCircleGroup = new GoGroup();
mCircleGroup.Size = new Size(50, 51);
mCircleGroup.Add(first_shape);
mCircleGroup.Add(second_shape);
this.Background = mCircleGroup;