SetSize

Graphics32

TBitmap32.SetSize

function SetSize(NewWidth, NewHeight: Integer): Boolean; override;

procedure SetSize(Source: TPersistent); // implemented in TCustomMap

Description

Call SetSize to set a new width and height of the bitmap. If one of the arguments is zero, the bitmap is considered empty and its Handle property is set to zero.

Calling SetSize works faster than consecutive changing of Width and Height properties. If you use another bitmap or control as an argument, the bitmap will be sized to source dimensions.

If you have an external TCanvas attached, refresh it Handle property after resizing:

Bitmap32.SetSize(100, 200);

Canvas.Handle := Bitmap32.Handle;

After the SetSize call the image the bitmap should be completely redrawn.

See Also

Handle, TCustomMap.Height, TCustomMap, TCustomMap.Width