Resize image to page
Visual Basic |
---|
Public Sub Resize( _ ByVal PageSize As EPageSize, _ Optional ByVal PageOrientation As EPageOrientation = epgoAuto, _ Optional ByVal ImageAlignment As EImageAlignment = epiaCenter, _ Optional ByVal Width As Double = 8.5, _ Optional ByVal Height As Double = 11, _ Optional ByVal Unit As ESizeUnit = esuInch _ ) |
- PageSize
Value Description epgsA4 A4 page size epgsCustom Custom image size epgsImage epgsLedger Ledger size epgsLegal Legal size epgsLetter Letter size epgsNearest epgsNearestMetric epgsNearestStd epgsOriginal Image size before image is modified - PageOrientation
Value Description epgoAuto Orientation is determind automaticaly epgoLandscape Use landscape orientation epgoPortrait Use portrait orientation - ImageAlignment
Value Description epiaBestFit epiaBottomCenter epiaBottomLeft epiaBottomRight epiaCenter epiaLeftCenter epiaRightCenter epiaStretch epiaTopCenter epiaTopLeft epiaTopRight - Width
- Height
- Unit
Value Description esuCentimeter esuInch esuPixel
Scanning document of standard size often produces images of slightly different dimension. Some image processing operations, like BorderExtract, AutoCrop, AutoDeskew change size of the image.
Resize method sets of an image to one of:
- Predefined size (PageSize, PageOrientation parameters)
- Custom size (PageSize = epgsCusom, Width, Height, Unit parameters)
- Size of the image when it was open (PageSize = epgsOriginal)
Image data before resizing are:
- Placed on resized image according to ImageAlignment parameter in the center of an new image, one of the corners, or aligned with center of one of sides. NOTE: If ImageAlignment is not epiaBestFit and new image size is smaller than original some of original image information will be lost.
- Scaled to occupy maximum area of resized image (ImageAlignment = epiaBestFit)