ImageEn, unit imageenview

TImageEnView.ApplyBitmapToSelection

TImageEnView.ApplyBitmapToSelection


Declaration

procedure ApplyBitmapToSelection(SrcBitmap: TBitmap; MaintainAspectRatio: Boolean = True; CanStretch: Boolean = False);
procedure ApplyBitmapToSelection(SrcBitmap: TIEBitmap; MergeAlpha: Boolean = True; MaintainAspectRatio: Boolean = True; CanStretch: Boolean = False);


Description

Applies a bitmap to the selected region, stretching the image to the selection size.
MergeAlpha will merge the alpha channel of the pasted bitmap with the background bitmap.
If MaintainAspectRatio is False the inserted image will fill the entire selection. Set MaintainAspectRatio to true to maintain the aspect ratio of the original bitmap. CanStretch determines whether a source image smaller than the selection is enlarged or maintains its original size.

Note: CanStretch has no effect if MaintainAspectRatio is False (image will always be stretched)


Example

// Flip just the selected portion of the image
aIEBitmap := TIEBitmap.create;
ImageEnView1.CopySelectionToBitmap( aIEBitmap );
aIEBitmap.Flip( fdVertical );
ImageEnView1.ApplyBitmapToSelection( aIEBitmap );
aIEBitmap.Free();

// PARAMETER CHANGE EXAMPLES
// Load Source Image
aIEBitmap.LoadFromFile( 'C:\Source.png' );


ImageEnView1.ApplyBitmapToSelection( aIEBitmap, True, False, False );


ImageEnView1.ApplyBitmapToSelection( aIEBitmap, True, True, False );


ImageEnView1.ApplyBitmapToSelection( aIEBitmap, True, True, True );



See Also

CopySelectionToBitmap