Language Reference Guide : 4. System Classes : BitmapObject Class : BlankBitmap Method
 
Share this page                  
BlankBitmap Method
The BlankBitmap method empties the bitmap object and builds a new bitmap of the specified size and color.
If a template bitmap object is supplied, its file name and dbhandle are copied to the bitmap being rebuilt. This does not trigger retrieval of the file or database bitmap corresponding to the file name or dbhandle.
BlankBitmap is particularly useful when a bitmap object must be modified—not replaced—or a bitmap must be increased in size without stretching the image it contains. In both cases it will be used in combination with ReplaceBitmap.
If the BitmapObject is attached to a FormField or a stored TaggedValue Item, using this in your program during development may change your frame's source definition. See BitmapObject Attributes and Methods Affecting the Frame Source (see BitmapObject Class).
This method has the following syntax:
integer = BitmapObject.BlankBitmap(width = integer, height = integer
          [, color = integer][, template = BitmapObject])
This method has the following parameters:
width
Specifies the width of the new bitmap, in pixels
height
Specifies the height of the new bitmap, in pixels
color
(Optional) Specifies the horizontal distance to search across, in pixels
template
(Optional) Specifies the bitmap object whose file name and dbhandle are being copied
The method returns ER_OK if successful. The bitmap object's errorstatus is also set to the return value.
Examples—BlankBitmap method:
The following code creates a single-pixel bitmap, which is then used to locate pixels of that color in another bitmap object:
imageB.BlankBitmap(width=1, height=1, color=RGB(red=255);
status = imageA.LocateBitmap(bitmap=imageB, x=Byref(x), y=Byref(y));
if status = ER_OK then
    string.Value = 'imageA contains a pure red pixel at location :x,:y';
    message string.ExpandParm(scope=curframe.Scope);
endif;
The following code puts a one-pixel blue border around the bitmap object’s image, without changing to a different bitmap object:
imageB = imageA.Duplicate();
imageA.BlankBitmap(width=imageA.WidthPixels+1, height=imageA.HeightPixels+1, color=RGB(blue=255));
imageA.ReplaceBitmap(replacement=imageB, x=2, y=2);