本文整理匯總了C#中System.Windows.Shapes.Polygon.Measure方法的典型用法代碼示例。如果您正苦於以下問題:C# Polygon.Measure方法的具體用法?C# Polygon.Measure怎麽用?C# Polygon.Measure使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Windows.Shapes.Polygon
的用法示例。
在下文中一共展示了Polygon.Measure方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CreateNewPolygon
private void CreateNewPolygon(Polygon oldPolygon)
{
i++;
string nazwa = oldPolygon.Name;
var newPolygon = new Polygon
{
Name = nazwa + i,
Stroke = oldPolygon.Stroke,
StrokeThickness = oldPolygon.StrokeThickness,
Fill = oldPolygon.Fill,
Points = oldPolygon.Points
};
newPolygon.MouseLeftButtonDown += new MouseButtonEventHandler(p_MouseLeftButtonDown);
//utworzenie 'faktycznych' wymiarów, inaczej 0
newPolygon.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
var polyWidth = newPolygon.DesiredSize.Width;
_dropPoint.X = _dropPoint.X - (polyWidth) / 2;
_dropPoint.Y = _dropArrow.Y2;
//MessageBox.Show(newPolygon.Name);
Console.Text += oldPolygon.Name + "\n";
Console.ScrollToEnd();
Canvas.SetLeft(newPolygon, _dropPoint.X);
Canvas.SetTop(newPolygon, _dropPoint.Y);
DropCanvas.Children.Add(newPolygon);
}