[This is preliminary documentation and is subject to change.]
Create a unit from pixels and a resolution. Useful for
working with images.
Namespace: TallComponents.WebAssembly: TallComponents.WebToPDF (in TallComponents.WebToPDF.dll) Version: 1.0.4.1
Syntax
| C# |
|---|
public static Unit FromPixels( int pixels, double dpi ) |
| Visual Basic |
|---|
Public Shared Function FromPixels ( _ pixels As Integer, _ dpi As Double _ ) As Unit |
Parameters
- pixels
- Type: System..::..Int32
Length in pixels
- dpi
- Type: System..::..Double
Resolution in dpi (Dots Per Inch)
Return Value
Remarks
Default resolution for screen display is normally 72dpi, though 96dpi is used by GDI+.
Examples
ImageShape image = new ImageShape( "image.jpg" ); image.KeepAspectRatio = true; // Calculate width at resolution of 300dpi image.Width = Unit.FromPixels( bitmap.Width, 300 );