LBitmapBase::Resize

#include "ltwrappr.h"

virtual L_INT LBitmapBase::Resize(pLBitmapDst, uStructSize, uFlags)

LBitmapBase * pLBitmapDst;

pointer to a LBitmapBase bitmap object to be updated

L_UINT uStructSize;

size of the BITMAPHANDLE structure

L_UINT uFlags;

flags that control the resize behavior

Resizes the class object's bitmap and places the resized bitmap in the destination class object.

Parameter Description
pLBitmapDst Pointer to a LBitmapBase bitmap object that will be updated with the resized bitmap.
uStructSize Size of the BITMAPHANDLE structure used by the object. Pass sizeof(BITMAPHANDLE).
uFlags Flags that control the behavior when resizing the bitmap. Use one of the following:
  Value Meaning
  SIZE_NORMAL [0x0000] Resize normally.
  SIZE_FAVORBLACK [0x0001] (Document/Medical only) Preserve black objects when making the image smaller. This option affects only 1-bit, black-and-white images, where it prevents the disappearance of thin lines. You can use a bitwise OR ( | ) to combine this flag with another one. For example, SIZE_RESAMPLE | SIZE_FAVORBLACK causes color images to be resampled, but applies the favor-black option to 1-bit, black-and-white images.
  SIZE_RESAMPLE [0x0002] Use linear interpolation and averaging to produce a higher-quality image.
  SIZE_BICUBIC [0x0004] Use bicubic interpolation and averaging to produce a higher quality image. This is slower than SIZE_RESAMPLE.
  SIZE_SCALETOGRAY [0x0008] (Document/Medical only). Use interpolation to display black and white images using shades of gray when the image is resized. This improves the readability when the image is scaled up or down. The generated image is 8-bit grayscale, so this option should be used only for black and white images.
  SIZE_OLD_RESAMPLE [0x0010] Use the old resample algorithm from LEADTOOLS 14.5.
SIZE_PREMULTIPLYALPHA [0x0020] Premultiply the alpha channel values when performing resize.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function will use the width and height specified in the destination class object for the resize operation.

Required DLLs and Libraries

LTDIS
LTFIL

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Win32, x64.

See Also

Functions:

LBitmapBase::Size, LBuffer::StartResize, LBuffer::Resize, LBuffer::StopResize, LBitmapBase::SizeInterpolate, Class Members

Topics:

Raster Image Functions: Doing Geometric Transformations

 

Resizing Considerations

 

Files and File Formats

Example

#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\")pFileName 
L_INT LBitmapBase__ResizeExample() 
{ 
   L_INT nRet; 
   LBitmapBase MyBitmap, ResizeBitmap; 
   nRet =MyBitmap.Load(MAKE_IMAGE_PATH(TEXT("image1.cmp"))); 
   if(nRet !=SUCCESS) 
      return nRet; 
   nRet =ResizeBitmap.Create(100,100,24,ORDER_BGR, NULL,TOP_LEFT,TYPE_CONV); 
   if(nRet !=SUCCESS) 
      return nRet; 
   nRet = MyBitmap.Resize(&ResizeBitmap, sizeof(BITMAPHANDLE), SIZE_NORMAL); //this will resize MyBitmap and put the resized image in ResizeBitmap 
   if(nRet !=SUCCESS) 
      return nRet; 
   return SUCCESS; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Raster Imaging C++ Class Library Help