Hello Vandana Matai,
... using Line is working but using StrokePath is not working. Why?
why it is not working is difficult to say. From technical point of view I don't see any obstacle to display a curve with separators. Let me analyze your application case once more. Accordingly I have understood you want to plot a sine curve and vertical line separators. The curve should appear with color X and the separators with color Y. You want both to be scaled equally. In such case:
1. Use two path objects. In object A stores the since curve data. In object B store the line separators.
2. To scale the path data stored in the objects A and B use two further path objects C and D.
3. Configure the object C to use the desired scaling factor by invoking its method C.Scale(...).
4. Copy the path contents from A to C using C.AddCopy( ..., A, ... ) method. C stores thereupon the contents from A being scaled.
5. Configure the object D to use the desired scaling factor by invoking its method D.Scale(...).
6. Copy the path contents from B to D using D.AddCopy( ..., B, ... ) method. D stores thereupon the contents from B being scaled.
7. Use two Stroke Path views E and F in your GUI component.
8. Connect the view E with path object C.
9. Configure the view E with the desired color to display the sine curve.
10. Connect the view F with path object D.
11. Configure the view F with the desired color to display the separators.
IMPORTANT: Since the separators are isolated line segments, it is obligatory to manage them as separate sub-paths. There is no possibility to have gaps within one sub-path. For example, if you want to display up to 10 vertical line separators, then the path object B has to be configured with capacity for at least 10 sub-path, by invoking the method B.SetMaxNoOfSubPath( 10 ) (See also Specify the maximum number of sub-paths).
For each new line separator you initialize the next following sub-path with capacity of 1 edge, and you add a single line segment to the sub-path. With the next line separator you do this on the next sub-path. For this purpose manage a counter of already recorded (stored lines). For example:
// When you want to add a new line separator
B.InitSubPath( noOfSeparatorsInThePathObjectB, 1 );
B.Begin( noOfSeparatorsInThePathObjectB, xPos, yPos1 );
B.AddLine( noOfSeparatorsInThePathObjectB, xPos, yPos2 );
noOfSeparatorsInThePathObjectB++;
This applies also to the scaled copy of the path B named above D. The path object D has also to manage multiple sub-path, one for each line separator. When you copy the contents from the path B to D (step 6 above) you do this in a loop for each sub-path. For example:
var int32 i;
for ( i = 0; i < noOfSeparatorsInThePathObjectB; i++ )
D.AddCopy( i, B, i, 0, B.GetNoOfEdges(i))
I hope it helps you further.
Best regards
Paul Banach