ConvertUtilPointToPixel Method (Double)

Converts points to pixels at 96 dpi.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public static double PointToPixel(
	double points
)

Parameters

points
Type: SystemDouble
The value to convert.

Return Value

Type: Double
Remarks
1 inch equals 72 points.
Examples
Shows how to use convert points to pixels with default and custom resolution.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

PageSetup pageSetup = builder.PageSetup;
pageSetup.TopMargin = ConvertUtil.PixelToPoint(2.0);

double myDpi = 192.0;

Console.WriteLine("The size of my top margin is {0} points, or {1} pixels with default resolution.",
    pageSetup.TopMargin, ConvertUtil.PointToPixel(pageSetup.TopMargin));

Console.WriteLine("The size of my top margin is {0} points, or {1} pixels with custom resolution.",
    pageSetup.TopMargin, ConvertUtil.PointToPixel(pageSetup.TopMargin, myDpi));
See Also