Rev | Line | |
---|
[12503] | 1 | using System.Windows;
|
---|
| 2 | using System.Windows.Media;
|
---|
| 3 |
|
---|
| 4 | namespace Microsoft.Research.DynamicDataDisplay.PointMarkers
|
---|
| 5 | {
|
---|
| 6 | /// <summary>Class that renders triangular marker at every point of graph</summary>
|
---|
| 7 | public class TrianglePointMarker : ShapePointMarker {
|
---|
| 8 | public override void Render(DrawingContext dc, Point screenPoint) {
|
---|
| 9 | Point pt0 = Point.Add(screenPoint, new Vector(-Size / 2, -Size / 2));
|
---|
| 10 | Point pt1 = Point.Add(screenPoint, new Vector(0, Size / 2));
|
---|
| 11 | Point pt2 = Point.Add(screenPoint, new Vector(Size / 2, -Size / 2));
|
---|
| 12 |
|
---|
| 13 | StreamGeometry streamGeom = new StreamGeometry();
|
---|
| 14 | using (var context = streamGeom.Open()) {
|
---|
| 15 | context.BeginFigure(pt0, true, true);
|
---|
| 16 | context.LineTo(pt1, true, true);
|
---|
| 17 | context.LineTo(pt2, true, true);
|
---|
| 18 | }
|
---|
| 19 | dc.DrawGeometry(Fill, Pen, streamGeom);
|
---|
| 20 | }
|
---|
| 21 | }
|
---|
| 22 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.