267 views
in Embedded Wizard Studio by
Hello,

We're using Graphics Path to specify clock hands:

 

this.HoursPath.InitMatrix();
this.HoursPath.SetMaxNoOfSubPaths( 1 );
this.HoursPath.Rotate( thetaHours );
this.HoursPath.InitSubPath( 0,1 );
this.HoursPath.Begin( 0, 0, -this.HoursHandStartOffset );
this.HoursPath.AddLine( 0 , 0, -this.HoursHandStartOffset - this.HoursHandLength );
this.HoursPath.Close(0);

This HoursPath is being used with a StrokedPath, and the line is drawn fine.

However, when we set StartCap and EndCap to round, we cannot get it to change shape.

(Width of hand is 9 pixels)

Do we need to do something else to make it round the ends? (We've increased the edge number of drawn an small line at the end of the first one to get a curved effect.)

1 Answer

0 votes
by

Hello,

try to remove the line with Close(0). Actually, when using Close() you create a 'closed' path without any start/end position. Accordingly, the configuration for StartCap and EndCap has no effect.

Does it help you further?

Best regards

Paul Banach

by
Ah, that helps. Thanks.

Will it be OK to call this fragment regularly as time changes? I don't want to introduce memory leaks.
by
Yes, it is safe. Each time you execute the code, the preceding path data is replaced instantly by the new data without memory leaks.

Best regards

Paut Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...