PDFReaderControls.NET Professional Type Reference

Unit.FromPixels Method 

Create a unit from pixels and a resolution. Useful for working with images.

public static Unit FromPixels(
   int pixels,
   double dpi
);

Parameters

pixels
Length in pixels
dpi
Resolution in dpi (Dots Per Inch)

Return Value

Remarks

Default resolution for screen display is normally 72dpi, though 96dpi is used by GDI+.

Example

   ImageShape image = new ImageShape( "image.jpg" );
   image.KeepAspectRatio = true;
   // Calculate width at resolution of 300dpi
   image.Width = Unit.FromPixels( bitmap.Width, 300 );

See Also

Unit Class | TallComponents.PDF Namespace