Class DisplayUnitsConverter

Class DisplayUnitsConverter

Nome do espaço: Aspose.Note Assembleia: Aspose.Note.dll (25.4.0)

A classe contém os métodos para converter valores.

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

Membros herdados

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

Methods

InchToPoint (Float) é um

Conversão de polegadas em pontos.

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

O valor para converter em polegadas.

Returns

float

O sistema é único.

Milímetros de Inch (Float)

Converter milímetros em polegadas.

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

Parameters

mm float

O valor a converter em milímetros.

Returns

float

O sistema é único.

Milímetros do ponto (float)

Converter milímetros em pontos.

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

Parameters

mm float

O valor a converter em milímetros.

Returns

float

O sistema é único.

PixelToPoint (int e float)

Converter pixels para pontos na resolução de pixel especificada.

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

Parameters

pixels int

O valor para converter em pixels.

dpi float

resolução de tela.

Returns

float

O sistema.Int32.

Pontífice da Flota (Float)

Converter pontos em polegadas.

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

O valor a ser convertido em pontos.

Returns

float

O sistema é único.

PointToPixel (Float e Float)

Converter pontos para pixels na resolução de pixel especificada.

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

Parameters

points float

O valor a ser convertido em pontos.

dpi float

resolução de tela.

Returns

int

O sistema.Int32.

 Português