871 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 - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...