本文整理汇总了C#中System.Windows.Media.DrawingContext.FillPolylineGeometry方法的典型用法代码示例。如果您正苦于以下问题:C# DrawingContext.FillPolylineGeometry方法的具体用法?C# DrawingContext.FillPolylineGeometry怎么用?C# DrawingContext.FillPolylineGeometry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.DrawingContext
的用法示例。
在下文中一共展示了DrawingContext.FillPolylineGeometry方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawTopSquare
void DrawTopSquare(DrawingContext dc)
{
PointCollection points = new PointCollection
{
new Point(Left, Top),
new Point(Right, Top),
new Point(Right, Bottom),
new Point(Right - ThinLineThickness, Bottom),
new Point(Right - ThinLineThickness, Top + LineThickness),
new Point(Left + ThinLineThickness, Top + LineThickness),
new Point(Left + ThinLineThickness, Bottom)
};
dc.FillPolylineGeometry(new Point(Left, Bottom), points);
}
示例2: DrawRightHarpoonUpBarb
private void DrawRightHarpoonUpBarb(DrawingContext dc)
{
PointCollection points = new PointCollection {
new Point(Right - FontSize * .3, Top),
//new Point(Right - FontSize * .31, Top + FontSize * .041),
new Point(Right - FontSize * .18, Bottom - FontSize * .06),
new Point(Left, Bottom - FontSize * .06),
new Point(Left, Bottom - FontSize * .02)
};
dc.FillPolylineGeometry(new Point(Right, Bottom - FontSize * .02), points);
}
示例3: DrawTortoise
private void DrawTortoise(DrawingContext dc)
{
PointCollection points = new PointCollection {
new Point(Left + Height * .5, Top),
new Point(Right - Height * .5, Top),
new Point(Right, Bottom),
new Point(Right - Height * .2, Bottom),
new Point(Right - Height * .7, Top + Height * .3),
new Point(Left + Height * .7, Top + Height * .3),
new Point(Left + Height * .2, Bottom)
};
dc.FillPolylineGeometry(new Point(Left, Bottom), points);
}
示例4: PaintVerticalBar
void PaintVerticalBar(DrawingContext dc)
{
PointCollection points = new PointCollection {
new Point(SignRight, Top),
new Point(SignRight, Bottom),
new Point(SignLeft, Bottom),
};
dc.FillPolylineGeometry(new Point(SignLeft, Top), points);
}
示例5: PaintRound
void PaintRound(DrawingContext dc)
{
if (Height < BracketBreakLimit)
{
if (SignType == BracketSignType.LeftRound)
{
signText.DrawTextTopLeftAligned(dc, new Point(SignLeft, Top));
}
else
{
signText.DrawTextTopRightAligned(dc, new Point(SignRight, Top));
}
}
else
{
if (SignType == BracketSignType.LeftRound)
{
double left = Math.Floor(SignLeft);
signText.DrawTextTopLeftAligned(dc, new Point(left, Top));
signText2.DrawTextBottomLeftAligned(dc, new Point(left, Bottom));
double top = Top + signText.Extent * .9;
double bottom = Bottom - signText2.Extent * .9;
//double topExtra = extension.Height + extension.OverhangAfter - extension.Extent;
double padding = extension.OverhangLeading;
var geometry = extension.BuildGeometry(new Point(left - padding, 0));
PointCollection points = new PointCollection { new Point(geometry.Bounds.Right, top),
new Point(geometry.Bounds.Right, bottom),
new Point(geometry.Bounds.Left, bottom),
};
dc.FillPolylineGeometry(new Point(geometry.Bounds.Left, top), points);
//Pen pen = PenManager.GetPen(extension.GetFullWidth() * .68);
//dc.DrawLine(pen, new Point(SignLeft + pen.Thickness * .68, top),
// new Point(SignLeft + pen.Thickness * .68, bottom));
////double topExtra = extension.Height + extension.OverhangAfter - extension.Extent;
////double padding = extension.OverhangLeading;
////var geometry = extension.BuildGeometry(new Point(SignLeft - padding, top - topExtra));
////Pen pen = new Pen(Brushes.Black, geometry.Bounds.Width);
////dc.DrawLine(pen, new Point(SignLeft + pen.Thickness - padding * 1.2, top),
//// new Point(SignLeft + LineThickness - padding * 1.2, bottom));
//var geometry2 = extension.BuildGeometry(new Point(SignLeft - 10, (top - topExtra)/2));
//var geometry3 = extension.BuildGeometry(new Point(SignLeft - 20, 10));
//double factor = (bottom - top) / (extension.Extent);
//ScaleTransform scale = new ScaleTransform(1.0, factor);
//scale.CenterY = extension.Extent / 2;
//scale.CenterY = geometry2.Bounds.Height;
//geometry2.Transform = scale;
//ScaleTransform scale2 = new ScaleTransform(1.0, 3);
//geometry3.Transform = scale2;
//dc.DrawGeometry(Brushes.Red, null, geometry);
//dc.DrawGeometry(Brushes.Blue, null, geometry2);
//dc.DrawGeometry(Brushes.Green, null, geometry3);
//var geo = Geometry.Combine(geometry, geometry, GeometryCombineMode.Intersect, scale);
//dc.DrawGeometry(Brushes.HotPink, null, geo);
//dc.PushTransform(scale);
//double topExtra = extension.Height + extension.OverhangAfter - extension.Extent;
//double padding = extension.OverhangLeading;
//dc.DrawText(extension, new Point(SignLeft - padding, top - (topExtra/factor)));
//dc.Pop();
//while (top < bottom)
//{
// extension.DrawTextTopLeftAligned(dc, new Point(SignLeft, top));
// top += extension.Extent *.85;
// double shoot = (top + extension.Extent) - bottom;
// if (shoot > 0)
// {
// top -= shoot;
// extension.DrawTextTopLeftAligned(dc, new Point(SignLeft, top));
// break;
// }
//}
}
else
{
signText.DrawTextTopRightAligned(dc, new Point(SignRight, Top));
signText2.DrawTextBottomRightAligned(dc, new Point(SignRight, Bottom));
double top = Top + signText.Extent * .9;
double bottom = Bottom - signText2.Extent * .9;
var geometry = extension.BuildGeometry(new Point(SignRight - extension.GetFullWidth() - extension.OverhangLeading, 0));
PointCollection points = new PointCollection { new Point(geometry.Bounds.Right, top),
new Point(geometry.Bounds.Right, bottom),
new Point(geometry.Bounds.Left, bottom),
};
dc.FillPolylineGeometry(new Point(geometry.Bounds.Left, top), points);
//double topExtra = extension.Height + extension.OverhangAfter - extension.Extent;
////double padding = extension.OverhangLeading;
////var geometry = extension.BuildGeometry(new Point(SignLeft, top));
////Pen pen = new Pen(Brushes.Black, geometry.Bounds.Width);
////dc.DrawLine(pen, new Point(SignRight - pen.Thickness * .65, top),
//// new Point(SignRight - pen.Thickness * .65, bottom));
//dc.DrawLine(new Pen(Brushes.Red, 1), new Point(SignLeft, Top), new Point(SignLeft, Bottom));
//Pen pen = PenManager.GetPen(extension.GetFullWidth() * .68);
//dc.DrawLine(pen, new Point(SignRight - pen.Thickness * .68, top),
// new Point(SignRight - pen.Thickness * .68, bottom));
//while (top < bottom)
//{
//.........这里部分代码省略.........
示例6: PaintRightSquareBar
void PaintRightSquareBar(DrawingContext dc)
{
PointCollection points = new PointCollection {
new Point(SignRight, Top),
new Point(SignRight, Bottom),
new Point(SignLeft, Bottom),
new Point(SignLeft, Bottom - ThinLineThickness),
new Point(SignRight - ThinLineThickness, Bottom - ThinLineThickness),
new Point(SignRight - ThinLineThickness, Top + ThinLineThickness),
new Point(SignLeft, Top + ThinLineThickness),
};
dc.FillPolylineGeometry(new Point(SignLeft, Top), points);
dc.DrawLine(ThinPen, new Point(SignRight - FontSize * .12, Top + ThinLineThickness * .5), new Point(SignRight - FontSize * .12, Bottom - ThinLineThickness * .5));
}
示例7: PaintRightSquare
void PaintRightSquare(DrawingContext dc)
{
PointCollection points = new PointCollection {
new Point(SignRight, Top),
new Point(SignRight, Bottom),
new Point(SignLeft, Bottom),
new Point(SignLeft, Bottom - ThinLineThickness),
new Point(SignRight - LineThickness, Bottom - ThinLineThickness),
new Point(SignRight - LineThickness, Top + ThinLineThickness),
new Point(SignLeft, Top + ThinLineThickness),
};
dc.FillPolylineGeometry(new Point(SignLeft, Top), points);
}
示例8: PaintCurly
void PaintCurly(DrawingContext dc)
{
if (Height < BracketBreakLimit)
{
signText.DrawTextTopLeftAligned(dc, new Point(SignLeft, Top));
}
else
{
if (SignType == BracketSignType.LeftCurly)
{
double left = SignLeft + midText.GetFullWidth() - extension.GetFullWidth();
signText.DrawTextTopLeftAligned(dc, new Point(left, Top));
//dc.DrawLine(new Pen(Brushes.Red, 1), new Point(left, Top), new Point(left, Bottom));
midText.DrawTextTopLeftAligned(dc, new Point(SignLeft, MidY - midText.Extent / 2));
signText2.DrawTextBottomLeftAligned(dc, new Point(left, Bottom));
double top = Top + signText.Extent * .9;
double bottom = MidY - midText.Extent * .4;
double padding = extension.OverhangLeading;
var geometry = extension.BuildGeometry(new Point(left - padding, 0));
PointCollection points = new PointCollection { new Point(geometry.Bounds.Right, top),
new Point(geometry.Bounds.Right, bottom),
new Point(geometry.Bounds.Left, bottom),
};
dc.FillPolylineGeometry(new Point(geometry.Bounds.Left, top), points);
//dc.DrawLine(new Pen(Brushes.Red, 1), new Point(Left, top), new Point(Right, top));
//dc.DrawLine(new Pen(Brushes.Red, 1), new Point(Left, bottom), new Point(Right, bottom));
//double padding = extension.OverhangLeading;
//double topExtra = extension.Height + extension.OverhangAfter - extension.Extent;
//var geometry = extension.BuildGeometry(new Point(SignLeft + midText.GetFullWidth(), top));
//double factor = ((bottom - top) / (extension.Extent)) * .95;
//ScaleTransform transform = new ScaleTransform(1, factor);
//transform.CenterY = extension.Extent / 2;
//geometry.Transform = transform;
//dc.DrawGeometry(Brushes.Red, null, geometry);
//dc.PushTransform(transform);
//Pen pen = new Pen(Brushes.Black, extension.GetFullWidth());
//dc.DrawText(extension, new Point(left - padding, (top/factor) - topExtra));
//dc.Pop();
//dc.DrawLine(pen, new Point(left + pen.Thickness * .65, top), new Point(left + pen.Thickness * .65, bottom));
//Pen pen = PenManager.GetPen(extension.GetFullWidth() * .68);
//dc.DrawLine(pen, new Point(left + pen.Thickness * .68, top),
// new Point(left + pen.Thickness * .68, bottom));
//while (top < bottom)
//{
// extension.DrawTextTopLeftAligned(dc, new Point(left, top));
// top += extension.Extent * .75;
// double shoot = (top + extension.Extent * .8) - bottom;
// if (shoot > 0)
// {
// top -= shoot;
// extension.DrawTextTopLeftAligned(dc, new Point(left, top));
// break;
// }
//}
top = MidY + midText.Extent * .4;
bottom = Bottom - signText2.Extent * .9;
points = new PointCollection { new Point(geometry.Bounds.Right, top),
new Point(geometry.Bounds.Right, bottom),
new Point(geometry.Bounds.Left, bottom),
};
dc.FillPolylineGeometry(new Point(geometry.Bounds.Left, top), points);
//dc.DrawLine(pen, new Point(left + pen.Thickness - padding * 1.2, top),
// new Point(left + pen.Thickness - padding * 1.2, bottom));
//dc.DrawLine(pen, new Point(left + pen.Thickness * .68, top),
// new Point(left + pen.Thickness * .68, bottom));
//while (top < bottom)
//{
// extension.DrawTextTopLeftAligned(dc, new Point(left, top));
// top += extension.Extent * .75;
// double shoot = (top + extension.Extent * .85) - bottom;
// if (shoot > 0)
// {
// top -= shoot;
// extension.DrawTextTopLeftAligned(dc, new Point(left, top));
// break;
// }
//}
}
else
{
double left = SignLeft + signText.GetFullWidth() - extension.GetFullWidth();
signText.DrawTextTopLeftAligned(dc, new Point(SignLeft, Top));
midText.DrawTextTopLeftAligned(dc, new Point(left, MidY - midText.Extent / 2));
signText2.DrawTextBottomLeftAligned(dc, new Point(SignLeft, Bottom));
double top = Top + signText.Extent * .9;
double bottom = MidY - midText.Extent * .4;
double padding = extension.OverhangLeading;
var geometry = extension.BuildGeometry(new Point(left - padding, 0));
PointCollection points = new PointCollection { new Point(geometry.Bounds.Right, top),
new Point(geometry.Bounds.Right, bottom),
new Point(geometry.Bounds.Left, bottom),
};
dc.FillPolylineGeometry(new Point(geometry.Bounds.Left, top), points);
//.........这里部分代码省略.........