ImageEn, unit iexBitmaps

TIEBitmap.MoveRegion

TIEBitmap.MoveRegion

Declaration

procedure MoveRegion(x1, y1, x2, y2, DstX, DstY: Integer; BackgroundValue: Double; FillSource: Boolean = True; MoveAlpha: Boolean = False);

Description

Moves a rectangle specified in x1, y1, x2, y2 to DstX, DstY position.
The BackgroundValue parameter specifies the color that fills the source rectangle.
If FillSource is True (default) then the source rectangle is filled with BackgroundValue.
If MoveAlpha is False, then MoveRegion doesn't copy the alpha channel.

Demo

Demo  Demos\ImageEditing\EveryMethod\EveryMethod.dpr

Examples

Also see: Automated Samples
// Move Region of 100, 100, 200, 200 to 300, 300, 400, 400. Replace with white
IEBitmap.MoveRegion( 100, 100, 200, 200, 300, 300, clWhite );


// Move the left half of the image to the right, filling the vacated area with red
ww := ImageEnView1.IEBitmap.Width div 2;
ImageEnView1.IEBitmap.MoveRegion( 0, 0, ww, ImageEnView1.IEBitmap.Height, ImageEnView1.IEBitmap.Width - ww, 0, clRed, True, False );
ImageEnView1.Update(); // Show changes in our viewer