Class Utils
Namespace: Aurigma.DesignAtoms.Model.Math
Assembly: Aurigma.DesignAtoms.Model.dll
Syntax
public class Utils
Inheritance: System.Object -> Utils
Inherited Members
System.Object.ToStringSystem.Object.Equals(System.Object)System.Object.Equals(System.Object,System.Object)System.Object.ReferenceEquals(System.Object,System.Object)System.Object.GetHashCodeSystem.Object.GetTypeSystem.Object.MemberwiseClone
Constructors
Utils
public Utils()
Methods
GetFitSize
public static SizeF GetFitSize(double sourceWidth, double sourceHeight, double targetWidth, double targetHeight)
Parameters
| Type | Name | Description |
|---|---|---|
System.Double | sourceWidth | |
System.Double | sourceHeight | |
System.Double | targetWidth | |
System.Double | targetHeight |
Returns
System.Drawing.SizeF
ConvertDegreeToRadian
public static double ConvertDegreeToRadian(double angle)
Parameters
| Type | Name | Description |
|---|---|---|
System.Double | angle |
Returns
System.Double
ConvertRadianToDegree
public static double ConvertRadianToDegree(double angle)
Parameters
| Type | Name | Description |
|---|---|---|
System.Double | angle |
Returns
System.Double
EqualsOfRectangleF
public static bool EqualsOfRectangleF(RectangleF rect1, RectangleF rect2, double tolerance = 0.0001)
Parameters
| Type | Name | Description |
|---|---|---|
System.Drawing.RectangleF | rect1 | |
System.Drawing.RectangleF | rect2 | |
System.Double | tolerance |
Returns
System.Boolean
EqualsOfFloatNumbers
public static bool EqualsOfFloatNumbers(double f1, double f2, double tolerance = 0.0001)
Parameters
| Type | Name | Description |
|---|---|---|
System.Double | f1 | |
System.Double | f2 | |
System.Double | tolerance |
Returns
System.Boolean
EqualsOfNullableFloats
public static bool EqualsOfNullableFloats(float? f1, float? f2, double tolerance = 0.0001)
Parameters
| Type | Name | Description |
|---|---|---|
System.Nullable<System.Single> | f1 | |
System.Nullable<System.Single> | f2 | |
System.Double | tolerance |
Returns
System.Boolean
EqualsOfPointF
public static bool EqualsOfPointF(PointF point1, PointF point2, double tolerance = 0.0001)
Parameters
| Type | Name | Description |
|---|---|---|
| Aurigma.DesignAtoms.Model.Math.PointF | point1 | |
| Aurigma.DesignAtoms.Model.Math.PointF | point2 | |
System.Double | tolerance |
Returns
System.Boolean
EqualsOfPointF
public static bool EqualsOfPointF(PointF point1, PointF point2, double tolerance = 0.0001)
Parameters
| Type | Name | Description |
|---|---|---|
System.Drawing.PointF | point1 | |
System.Drawing.PointF | point2 | |
System.Double | tolerance |
Returns
System.Boolean
ConvertPointsToPixels
public static Path ConvertPointsToPixels(float dpi, Path path)
Parameters
| Type | Name | Description |
|---|---|---|
System.Single | dpi | |
| Aurigma.DesignAtoms.Model.Math.Path | path |
Returns
Aurigma.DesignAtoms.Model.Math.Path
ConvertPointsToPixels
public static RotatedRectangleF ConvertPointsToPixels(float dpi, RotatedRectangleF rect)
Parameters
| Type | Name | Description |
|---|---|---|
System.Single | dpi | |
| Aurigma.DesignAtoms.Model.Math.RotatedRectangleF | rect |
Returns
Aurigma.DesignAtoms.Model.Math.RotatedRectangleF
ConvertPointsToPixels
public static int ConvertPointsToPixels(float dpi, float points)
Parameters
| Type | Name | Description |
|---|---|---|
System.Single | dpi | |
System.Single | points |
Returns
System.Int32
ConvertPointsToPixelsFloat
public static float ConvertPointsToPixelsFloat(float dpi, float points)
Parameters
| Type | Name | Description |
|---|---|---|
System.Single | dpi | |
System.Single | points |
Returns
System.Single
ConvertPointsToPixelsFloat
public static PointF ConvertPointsToPixelsFloat(float dpi, PointF point)
Parameters
| Type | Name | Description |
|---|---|---|
System.Single | dpi | |
| Aurigma.DesignAtoms.Model.Math.PointF | point |
Returns
Aurigma.DesignAtoms.Model.Math.PointF
ConvertPixelsToPoints
public static float ConvertPixelsToPoints(float dpi, int pixels)
Parameters
| Type | Name | Description |
|---|---|---|
System.Single | dpi | |
System.Int32 | pixels |
Returns
System.Single
ConvertPixelsToPoints
public static float ConvertPixelsToPoints(float dpi, float pixels)
Parameters
| Type | Name | Description |
|---|---|---|
System.Single | dpi | |
System.Single | pixels |
Returns
System.Single
ConvertPixelsToPoints
public static IEnumerable<float> ConvertPixelsToPoints(float dpi, IEnumerable<float> pixels)
Parameters
| Type | Name | Description |
|---|---|---|
System.Single | dpi | |
System.Collections.Generic.IEnumerable<System.Single> | pixels |
Returns
System.Collections.Generic.IEnumerable<System.Single>
ConvertPixelsToPoints
public static RectangleF ConvertPixelsToPoints(float dpi, RectangleF pixelRect)
Parameters
| Type | Name | Description |
|---|---|---|
System.Single | dpi | |
System.Drawing.RectangleF | pixelRect |
Returns
System.Drawing.RectangleF
ConvertPointsToPixels
public static RectangleF ConvertPointsToPixels(float dpi, RectangleF pointRect)
Parameters
| Type | Name | Description |
|---|---|---|
System.Single | dpi | |
System.Drawing.RectangleF | pointRect |
Returns
System.Drawing.RectangleF
GetCenter
public static PointF GetCenter(RectangleF rect)
Parameters
| Type | Name | Description |
|---|---|---|
System.Drawing.RectangleF | rect |
Returns
Aurigma.DesignAtoms.Model.Math.PointF
ScaleFloat
public static float ScaleFloat(float value, float scale, float? minimum, float? maximum)
Parameters
| Type | Name | Description |
|---|---|---|
System.Single | value | |
System.Single | scale | |
System.Nullable<System.Single> | minimum | |
System.Nullable<System.Single> | maximum |
Returns
System.Single
RoundFloat
public static float RoundFloat(float value, int digits)
Parameters
| Type | Name | Description |
|---|---|---|
System.Single | value | |
System.Int32 | digits |
Returns
System.Single