Class DisplayUnitsConverter
Class DisplayUnitsConverter
이름 공간 : Aspose.Note 모임: Aspose.Note.dll (25.4.0)
클래스는 가치를 변환하는 방법을 포함합니다.
public static class DisplayUnitsConverter
{
public static double Convert(double value, DisplayUnits from, DisplayUnits to)
{
switch (from)
{
case DisplayUnits.Millimeters:
return ToCentimeters(value) * ToMeters(100) * ToKilometers(100000);
case DisplayUnits.Centimeters:
return value * ToMeters(100) * ToKilometers(100000);
case DisplayUnits.Meters:
return value * ToKilometers(1000);
default:
throw new ArgumentException("Invalid input unit");
}
double ToMillimeters(double value) => value * 10;
double ToCentimeters(double value) => value / 10;
double ToMeters(double value) => value / 100;
double ToKilometers(double value) => value / 1000;
}
}
Inheritance
object ← DisplayUnitsConverter
상속 회원들
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Methods
인치토포인트(Float)
인치를 포인트로 변환합니다.
public static float InchToPoint(float inches)
{
}
In this case, since there are no nested structures or complex conditions in the provided code snippet, the output remains the same as the input. For more complex scenarios, proper indentation will be applied according to standard C# conventions.
Parameters
inches
float
가치를 인치로 변환합니다.
Returns
시스템 - 단일
밀리미터 토인치(Float)
밀리미터를 인치로 변환합니다.
public static float MillimeterToInch(float mm)
{
const float CONVERSION_FACTOR = 25.4f;
return mm * CONVERSION_FACTOR;
}
Parameters
mm
float
값을 밀리미터로 변환합니다.
Returns
시스템 - 단일
밀리미터 토포인트(Float)
밀리미터를 포인트로 변환합니다.
public static float MillimeterToPoint(float mm)
{
return mm * 25.4f;
}
Parameters
mm
float
값을 밀리미터로 변환합니다.
Returns
시스템 - 단일
픽셀토포인트(int, float)
지정된 픽셀 해상도에서 피크셀을 포인트로 변환합니다.
public static float PixelToPoint(int pixels, float dpi)
{
}
Parameters
pixels
int
값을 픽셀로 변환합니다.
dpi
float
스크린 해상도
Returns
시스템.Int32에 해당되는 글 1건
포인트 토인치(Float)
포인트를 인치로 변환합니다.
public static float PointToInch(float points)
{
}
Here's a version with consistent spacing and indentation according to standard C# conventions:
public static float PointToInch(float points)
{
}
Parameters
points
float
값을 포인트로 변환합니다.
Returns
시스템 - 단일
포인트토 픽셀(Float, Float)
지정된 픽셀 해상도에서 포인트를 피크셀로 변환합니다.
public static int PointToPixel(float points, float dpi)
{
}
Parameters
points
float
값을 포인트로 변환합니다.
dpi
float
스크린 해상도
Returns
시스템.Int32에 해당되는 글 1건