Class DisplayUnitsConverter

Class DisplayUnitsConverter

Tên không gian: Aspose.Note Tổng hợp: Aspose.Note.dll (25.4.0)

Khóa học chứa các phương pháp để chuyển đổi giá trị.

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

Thành viên thừa kế

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Methods

Tính năng InchToPoint (Float)

Chuyển đổi inch thành điểm.

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

Giá trị để chuyển đổi thành inch.

Returns

float

Hệ thống duy nhất.

Máy bay (Millimeter ToInch)

Chuyển đổi milimeter thành inch.

public static float MillimeterToInch(float mm)
    {
        const float CONVERSION_FACTOR = 25.4f;
        return mm * CONVERSION_FACTOR;
    }

Parameters

mm float

Giá trị để chuyển đổi thành millimeters.

Returns

float

Hệ thống duy nhất.

MillimeterToPoint (máy bay)

Chuyển đổi milimeter thành điểm.

public static float MillimeterToPoint(float mm)
   {
      return mm * 25.4f;
   }

Parameters

mm float

Giá trị để chuyển đổi thành millimeters.

Returns

float

Hệ thống duy nhất.

PixelToPoint (int và float)

Chuyển đổi pixels thành điểm ở độ phân giải pixel cụ thể.

public static float PixelToPoint(int pixels, float dpi)
   {
   }

Parameters

pixels int

Giá trị để chuyển đổi thành pixels.

dpi float

Độ phân giải màn hình

Returns

float

Hệ thống.Int32.

Bảng giá PointToInch (Float)

Chuyển đổi điểm sang inch.

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

Giá trị để chuyển đổi thành điểm.

Returns

float

Hệ thống duy nhất.

PointToPixel (máy bay, máy bay)

Chuyển đổi điểm sang pixels ở độ phân giải pixel cụ thể.

public static int PointToPixel(float points, float dpi)
   {
   }

Parameters

points float

Giá trị để chuyển đổi thành điểm.

dpi float

Độ phân giải màn hình

Returns

int

Hệ thống.Int32.

 Tiếng Việt