Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits. |
Resizing Considerations
Resizing a bitmap physically changes its width and height, and changes the number of bytes required to store the image. This is different from zooming, which mathematically changes the displayed size of the image, without affecting the stored data.
When resizing an image to enlarge it, LEADTOOLS must find enough room to hold the resulting image. If necessary, LEADTOOLS uses virtual memory (disk space treated as memory). On 32- and 64-bit systems, it uses the system's virtual memory.
On a 16-bit system, it looks for memory as follows:
1. |
First it checks the Windows system resources (including 386 Enhanced virtual memory). |
2. |
If the Windows system resources are insufficient, it checks the available space on the disk specified for temporary files (defined using the TEMP or TMP environment variable). |
If there is not enough memory or virtual memory to hold the resulting image, the function returns an error code.
To resize a buffer to a new specified size, use LBuffer::Resize . To set up information for the LBuffer::Resize function, use LBuffer::StartResize . When all lines have been processed, you must call LBuffer::StopResize to clean up all data variables and buffers allocated by LBuffer::StartResize and reset all internal variables to their default settings.
To resize the image from an existing bitmap, and put the resized image into a destination bitmap while leaving the original bitmap intact, use LBitmapBase::Resize .
To resize a bitmap region by the specified number of pixels, use LBitmapRgn::ResizeRgn .
To resize a bitmap to a new width and height, use LBitmapBase::Size .
LBitmapBase::SizeInterpolate provides additional resizing methods.