Language Reference Guide : System Classes : BitmapObject Class : ResizeBitmap Method
 
Share this page          
ResizeBitmap Method
The ResizeBitmap method changes the size of the bitmap to a specified new size.
Bilinear
Provides “smooth” resizing by computing and applying the intermediate colors between two originally adjacent pixels.
Bilinear preserves acceptable bitmap appearance in the widest range of cases. Bitmaps with strongly defined edges show marked edge-softening for significant resizings. It is the slowest mode. If the bitmap contains transparent areas that must be preserved during the resizing, use the clearcolor attribute to specify the transparency color.
Block
Applies only the original colors to any new pixels added during expansion. Block resize is best for small images whose detail must be inspected at a higher scale.
Halftone
Performs a partial smoothing. Halftone is particularly useful in preserving appearance where the resizing involves shrinking the bitmap.
ResizeBitmap does not change the host bitmap object, unless that object is explicitly passed using the bitmap parameter.
This method has the following syntax:
BitmapObject = BitmapObject.ResizeBitmap(width = integer, height = integer,
          resizemode = integer[, bitmap = BitmapObject]
          [, clearcolor = integer])
This statement has the following parameters:
width
(Required) Specifies the width in pixels to which the bitmap is to be resized.
height
(Required) Specifies the height in pixels to which the bitmap is to be resized.
resizemode
(Required) Specifies the mode of resizing to apply. Valid options are:
BD_BILINEARRESIZE
Resizes the bitmap using a bilinear algorithm.
BD_BLOCKRESIZE
Resizes the bitmap using a simple block algorithm. Only the original colors are used.
BD_HALFTONERESIZE
Resizes the bitmap using a partial-smoothing algorithm.
For more information about system constant settings, see Bitmap Settings for BitmapObject.
bitmap
Specifies a bitmap object to which the change is to be applied. If bitmap is not specified, a new bitmap object is created and returned.
clearcolor
Specifies the transparency color of the bitmap. The value passed must be an RGB value, not a CC value.
The method returns the passed bitmap or a new bitmap object.
If the method fails, it returns either the passed bitmap (unchanged) or NULL, and the errorstatus of the host bitmap object is set to a non-zero value. Descriptions of system constant values and their numeric equivalents are listed in Error Codes.