procedure ChangeSize(var Width, Height: Integer; NewWidth, NewHeight: Integer; ClearBuffer: Boolean = True); virtual; abstract;


ChangeSize shall initialize the surface with the dimensions of NewWidth x NewHeight both measured in pixels. Each pixel has to be 4 byte (ARGB) in size. The allocated memory has to be contiguous with the stride being the length of NewWidth. GR32 currently does not support stride lengths different from the width of the new surface. The pointer to the allocated memory has to be written to the protected member FBits.
The ClearBuffer parameter determines whether clearing the buffer is required or not.

Before tearing down the old surface ChangeSize needs to call the Changing method to indicate the destructive change. Finally it has to call Changed.

Width and Height shall contain the dimension of the new surface that was actually allocated. If the surface could not be allocated both parameter have to be zero.

New back-end classes need to implement this method to do their internal allocation of memory for the surface.


See Also

Changing, FinalizeSurface, InitializeSurface, TNotifiablePersistent.Changed