UtilDrawingGetSquareSimilarityPercentage(Int32, Int32) Method
Determine the similarity percentage that the specified
Size has with a square shape,
by dividing its shortest side between the longest one.
For example, having a
Size of 4x4 (Width x Height),
this function will return a value of 1, meaning that all the
sides ( {Top=4, Bottom=4, Left=4, Right=4} ) are of equal length,
or in other words, it is a perfect square shape.
For example too, having a
Size of 640x480 (Width x Height),
this function will return a value of 0.75, meaning that the length of the
sides ( {Top=640, Bottom=640, Left=480, Right=480} ) are 75% near to be a perfect square shape.
Namespace: DevCase.Core.Media.GraphicsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static double GetSquareSimilarityPercentage(
int width,
int height
)
Public Shared Function GetSquareSimilarityPercentage (
width As Integer,
height As Integer
) As Double
Dim width As Integer
Dim height As Integer
Dim returnValue As Double
returnValue = UtilDrawing.GetSquareSimilarityPercentage(width,
height)
public:
static double GetSquareSimilarityPercentage(
int width,
int height
)
static member GetSquareSimilarityPercentage :
width : int *
height : int -> float
No code example is currently available or this language may not be supported.
- width Int32
-
The source width.
- height Int32
-
The source height.
Double
The resulting similarity, expressed as a percentage value between 0 (as minimum) to 1.0 (as maximum).
This is a code example.
No code example is currently available or this language may not be supported.
Dim width As Integer = 640
Dim height As Integer = 480
Dim prc As Double = GetSquareSimilarityPercentage(width, height)
Dim str As String = String.Format("Square similarity of {0}: {1:P2}", New Size(width, height).ToString(), prc, CultureInfo.InvariantCulture)
Console.WriteLine(str)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.