VerticalResolution

TiffImage.VerticalResolution property

Får den vertikala upplösningen, i pixlar per tum, av dettaImage .

public override double VerticalResolution { get; set; }

Fastighetsvärde

Den vertikala upplösningen.

Anmärkningar

Notera som standard att detta värde alltid är 96 eftersom olika plattformar inte kan returnera skärmupplösningen. Du kan överväga att använda metoden SetResolution för att uppdatera båda upplösningsvärdena i ett enda samtal.

Exempel

Följande exempel visar hur man ställer in horisontell/vertikal upplösning för en TIFF-bild.

[C#]

string dir = "c:\\temp\\";

using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.tif"))
{
    Aspose.Imaging.FileFormats.Tiff.TiffImage tiffImage = (Aspose.Imaging.FileFormats.Tiff.TiffImage)image;

    // Få horisontell och vertikal upplösning av TiffImage.
    double horizontalResolution = tiffImage.HorizontalResolution;
    double verticalResolution = tiffImage.VerticalResolution;
    System.Console.WriteLine("The horizontal resolution, in pixels per inch: {0}", horizontalResolution);
    System.Console.WriteLine("The vertical resolution, in pixels per inch: {0}", verticalResolution);

    if (horizontalResolution != 96.0 || verticalResolution != 96.0)
    {
        // Använd metoden SetResolution för att uppdatera båda upplösningsvärdena i ett enda anrop.
        System.Console.WriteLine("Set resolution values to 96 dpi");
        tiffImage.SetResolution(96.0, 96.0);

        System.Console.WriteLine("The horizontal resolution, in pixels per inch: {0}", tiffImage.HorizontalResolution);
        System.Console.WriteLine("The vertical resolution, in pixels per inch: {0}", tiffImage.VerticalResolution);
    }
}

Se även