本文整理汇总了C#中System.Drawing.SizeF.ToPointF方法的典型用法代码示例。如果您正苦于以下问题:C# SizeF.ToPointF方法的具体用法?C# SizeF.ToPointF怎么用?C# SizeF.ToPointF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.SizeF
的用法示例。
在下文中一共展示了SizeF.ToPointF方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConvertToSource
/// <summary>
/// Converts a <see cref="SizeF"/> from destination to source coordinates.
/// </summary>
/// <remarks>
/// Only scale and rotation are applied when converting sizes; this is equivalent
/// to converting a direction vector, as direction vectors have only magnitude
/// and direction information, but no position.
/// </remarks>
public SizeF ConvertToSource(SizeF destinationDimensions)
{
PointF[] transformed = new PointF[] {destinationDimensions.ToPointF()};
Matrix inverse = this.CumulativeTransform.Clone();
inverse.Invert();
inverse.TransformVectors(transformed);
return new SizeF(transformed[0]);
}
示例2: ConvertToDestination
/// <summary>
/// Converts a <see cref="SizeF"/> from source to destination coordinates.
/// </summary>
/// <remarks>
/// Only scale and rotation are applied when converting sizes; this is equivalent
/// to converting a direction vector, as direction vectors have only magnitude
/// and direction information, but no position.
/// </remarks>
public SizeF ConvertToDestination(SizeF sourceDimensions)
{
PointF[] transformed = new PointF[] {sourceDimensions.ToPointF()};
this.CumulativeTransform.TransformVectors(transformed);
return new SizeF(transformed[0]);
}