VerticalResolution
TiffImage.VerticalResolution property
获取垂直分辨率(以每英寸像素为单位)Image
.
public override double VerticalResolution { get; set; }
适当的价值
垂直分辨率。
评论
请注意,默认情况下,此值始终为 96,因为不同的平台无法返回屏幕分辨率。您可以考虑使用 SetResolution 方法在一次调用中更新两个分辨率值。
例子
以下示例显示如何设置 TIFF 图像的水平/垂直分辨率。
[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;
// 获取 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)
{
// 使用 SetResolution 方法在一次调用中更新两个分辨率值。
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);
}
}
也可以看看
- class TiffImage
- 命名空间 Aspose.Imaging.FileFormats.Tiff
- 部件 Aspose.Imaging