Class PdfUnitConverter
Inheritance
Namespace: Syncfusion.Pdf.Graphics
Assembly: Syncfusion.Pdf.Portable.dll
Syntax
public class PdfUnitConverter : Object
Constructors
PdfUnitConverter()
Initializes a new instance of the PdfUnitConvertor class with default DPI value of 96.
Declaration
public PdfUnitConverter()
PdfUnitConverter(Single)
Initializes a new instance of the UnitConvertor class with DPI value
Declaration
public PdfUnitConverter(float dpi)
Parameters
Type | Name | Description |
---|---|---|
System.Single | dpi | The dpi. |
Methods
ConvertFromPixels(PointF, PdfGraphicsUnit)
Converts rectangle from pixels to specified units
Declaration
public PointF ConvertFromPixels(PointF point, PdfGraphicsUnit to)
Parameters
Type | Name | Description |
---|---|---|
PointF | point | point in pixels units |
PdfGraphicsUnit | to | convert to units |
Returns
Type | Description |
---|---|
PointF | output Point in specified units |
ConvertFromPixels(RectangleF, PdfGraphicsUnit)
Converts rectangle in Pixels into rectangle with specified measure units
Declaration
public RectangleF ConvertFromPixels(RectangleF rect, PdfGraphicsUnit to)
Parameters
Type | Name | Description |
---|---|---|
RectangleF | rect | source rectangle in pixels units |
PdfGraphicsUnit | to | convert to units |
Returns
Type | Description |
---|---|
RectangleF | output Rectangle in specified units |
ConvertFromPixels(SizeF, PdfGraphicsUnit)
Converts Size in pixels to size in specified measure units
Declaration
public SizeF ConvertFromPixels(SizeF size, PdfGraphicsUnit to)
Parameters
Type | Name | Description |
---|---|---|
SizeF | size | source size |
PdfGraphicsUnit | to | convert to units |
Returns
Type | Description |
---|---|
SizeF | output size in specified measure units |
ConvertFromPixels(Single, PdfGraphicsUnit)
Converts value, to specified graphics unit from Pixel.
Declaration
public float ConvertFromPixels(float value, PdfGraphicsUnit to)
Parameters
Type | Name | Description |
---|---|---|
System.Single | value | Value to convert |
PdfGraphicsUnit | to | Indicates units to convert to |
Returns
Type | Description |
---|---|
System.Single | Value stored in "to" units |
ConvertToPixels(PointF, PdfGraphicsUnit)
Converts point from specified graphics units to pixels
Declaration
public PointF ConvertToPixels(PointF point, PdfGraphicsUnit from)
Parameters
Type | Name | Description |
---|---|---|
PointF | point | source point for convert |
PdfGraphicsUnit | from | measure units |
Returns
Type | Description |
---|---|
PointF | point in pixels coordinates |
ConvertToPixels(RectangleF, PdfGraphicsUnit)
Converts the rectangle location and size to Pixels from specified measure units
Declaration
public RectangleF ConvertToPixels(RectangleF rect, PdfGraphicsUnit from)
Parameters
Type | Name | Description |
---|---|---|
RectangleF | rect | source rectangle |
PdfGraphicsUnit | from | source rectangle measure units |
Returns
Type | Description |
---|---|
RectangleF | Rectangle with Pixels |
ConvertToPixels(SizeF, PdfGraphicsUnit)
Converts size from specified graphics units to pixels
Declaration
public SizeF ConvertToPixels(SizeF size, PdfGraphicsUnit from)
Parameters
Type | Name | Description |
---|---|---|
SizeF | size | source size |
PdfGraphicsUnit | from | measure units |
Returns
Type | Description |
---|---|
SizeF | size in pixels |
ConvertToPixels(Single, PdfGraphicsUnit)
Converts the value to pixel from specified graphics unit.
Declaration
public float ConvertToPixels(float value, PdfGraphicsUnit from)
Parameters
Type | Name | Description |
---|---|---|
System.Single | value | Value to convert |
PdfGraphicsUnit | from | Indicates units to convert from |
Returns
Type | Description |
---|---|
System.Single | Value stored in pixels |
ConvertUnits(Single, PdfGraphicsUnit, PdfGraphicsUnit)
Converts the value, from one graphics unit to another graphics unit.
Declaration
public float ConvertUnits(float value, PdfGraphicsUnit from, PdfGraphicsUnit to)
Parameters
Type | Name | Description |
---|---|---|
System.Single | value | Value to convert |
PdfGraphicsUnit | from | Indicates units to convert from |
PdfGraphicsUnit | to | Indicates units to convert to |
Returns
Type | Description |
---|---|
System.Single | Value stored in "to" units |