Skip to main content

Class Utils

Namespace: Aurigma.DesignAtoms.Model.Math​
Assembly: Aurigma.DesignAtoms.Model.dll​
Syntax
public class Utils

Inheritance: System.Object -> Utils

Inherited Members​

  • System.Object.ToString
  • System.Object.Equals(System.Object)
  • System.Object.Equals(System.Object,System.Object)
  • System.Object.ReferenceEquals(System.Object,System.Object)
  • System.Object.GetHashCode
  • System.Object.GetType
  • System.Object.MemberwiseClone

Constructors​

Utils​

public Utils()

Methods​

GetFitSize​

public static SizeF GetFitSize(double sourceWidth, double sourceHeight, double targetWidth, double targetHeight)
Parameters​
TypeNameDescription
System.DoublesourceWidth
System.DoublesourceHeight
System.DoubletargetWidth
System.DoubletargetHeight
Returns​

System.Drawing.SizeF

ConvertDegreeToRadian​

public static double ConvertDegreeToRadian(double angle)
Parameters​
TypeNameDescription
System.Doubleangle
Returns​

System.Double

ConvertRadianToDegree​

public static double ConvertRadianToDegree(double angle)
Parameters​
TypeNameDescription
System.Doubleangle
Returns​

System.Double

EqualsOfRectangleF​

public static bool EqualsOfRectangleF(RectangleF rect1, RectangleF rect2, double tolerance = 0.0001)
Parameters​
TypeNameDescription
System.Drawing.RectangleFrect1
System.Drawing.RectangleFrect2
System.Doubletolerance
Returns​

System.Boolean

EqualsOfFloatNumbers​

public static bool EqualsOfFloatNumbers(double f1, double f2, double tolerance = 0.0001)
Parameters​
TypeNameDescription
System.Doublef1
System.Doublef2
System.Doubletolerance
Returns​

System.Boolean

EqualsOfNullableFloats​

public static bool EqualsOfNullableFloats(float? f1, float? f2, double tolerance = 0.0001)
Parameters​
TypeNameDescription
System.Nullable<System.Single>f1
System.Nullable<System.Single>f2
System.Doubletolerance
Returns​

System.Boolean

EqualsOfPointF​

public static bool EqualsOfPointF(PointF point1, PointF point2, double tolerance = 0.0001)
Parameters​
TypeNameDescription
Aurigma.DesignAtoms.Model.Math.PointFpoint1
Aurigma.DesignAtoms.Model.Math.PointFpoint2
System.Doubletolerance
Returns​

System.Boolean

EqualsOfPointF​

public static bool EqualsOfPointF(PointF point1, PointF point2, double tolerance = 0.0001)
Parameters​
TypeNameDescription
System.Drawing.PointFpoint1
System.Drawing.PointFpoint2
System.Doubletolerance
Returns​

System.Boolean

ConvertPointsToPixels​

public static Path ConvertPointsToPixels(float dpi, Path path)
Parameters​
TypeNameDescription
System.Singledpi
Aurigma.DesignAtoms.Model.Math.Pathpath
Returns​

Aurigma.DesignAtoms.Model.Math.Path

ConvertPointsToPixels​

public static RotatedRectangleF ConvertPointsToPixels(float dpi, RotatedRectangleF rect)
Parameters​
TypeNameDescription
System.Singledpi
Aurigma.DesignAtoms.Model.Math.RotatedRectangleFrect
Returns​

Aurigma.DesignAtoms.Model.Math.RotatedRectangleF

ConvertPointsToPixels​

public static int ConvertPointsToPixels(float dpi, float points)
Parameters​
TypeNameDescription
System.Singledpi
System.Singlepoints
Returns​

System.Int32

ConvertPointsToPixelsFloat​

public static float ConvertPointsToPixelsFloat(float dpi, float points)
Parameters​
TypeNameDescription
System.Singledpi
System.Singlepoints
Returns​

System.Single

ConvertPointsToPixelsFloat​

public static PointF ConvertPointsToPixelsFloat(float dpi, PointF point)
Parameters​
TypeNameDescription
System.Singledpi
Aurigma.DesignAtoms.Model.Math.PointFpoint
Returns​

Aurigma.DesignAtoms.Model.Math.PointF

ConvertPixelsToPoints​

public static float ConvertPixelsToPoints(float dpi, int pixels)
Parameters​
TypeNameDescription
System.Singledpi
System.Int32pixels
Returns​

System.Single

ConvertPixelsToPoints​

public static float ConvertPixelsToPoints(float dpi, float pixels)
Parameters​
TypeNameDescription
System.Singledpi
System.Singlepixels
Returns​

System.Single

ConvertPixelsToPoints​

public static IEnumerable<float> ConvertPixelsToPoints(float dpi, IEnumerable<float> pixels)
Parameters​
TypeNameDescription
System.Singledpi
System.Collections.Generic.IEnumerable<System.Single>pixels
Returns​

System.Collections.Generic.IEnumerable<System.Single>

ConvertPixelsToPoints​

public static RectangleF ConvertPixelsToPoints(float dpi, RectangleF pixelRect)
Parameters​
TypeNameDescription
System.Singledpi
System.Drawing.RectangleFpixelRect
Returns​

System.Drawing.RectangleF

ConvertPointsToPixels​

public static RectangleF ConvertPointsToPixels(float dpi, RectangleF pointRect)
Parameters​
TypeNameDescription
System.Singledpi
System.Drawing.RectangleFpointRect
Returns​

System.Drawing.RectangleF

GetCenter​

public static PointF GetCenter(RectangleF rect)
Parameters​
TypeNameDescription
System.Drawing.RectangleFrect
Returns​

Aurigma.DesignAtoms.Model.Math.PointF

ScaleFloat​

public static float ScaleFloat(float value, float scale, float? minimum, float? maximum)
Parameters​
TypeNameDescription
System.Singlevalue
System.Singlescale
System.Nullable<System.Single>minimum
System.Nullable<System.Single>maximum
Returns​

System.Single

RoundFloat​

public static float RoundFloat(float value, int digits)
Parameters​
TypeNameDescription
System.Singlevalue
System.Int32digits
Returns​

System.Single

Was this page helpful?