| ImageEn, unit imageenproc |
|
TImageEnProc.SetFromRGBChannels
Declaration
procedure SetFromRGBChannels(BitmapR, BitmapG, BitmapB: TIEBitmap); overload;
procedure SetFromRGBChannels(Channel: TIEChannel; Bitmap: TIEBitmap); overload;
Description
Creates an image from R, G and B channel bitmaps, e.g. as created by
GetRGBChannel (all existing content, including
Alpha will be cleared, and resulting bitmap will be ie24RGB format).
BitmapR, BitmapG and BitmapB must be the same size and should be ie8g or ie24RGB gray-scale images.
With second overload, it updates only one of the color channels, and also maintains the
AlphaChannel.
Demos
| Demos\ImageEditing\RGBChannels\RGBChannels.dpr |
| Demos\ImageEditing\EveryMethod\EveryMethod.dpr |
Example
ImageEnView1.Proc.GetRGBChannel( ImageEnViewRed.IEBitmap, ImageEnViewGreen.IEBitmap, ImageEnViewBlue.IEBitmap );
ImageEnViewRed.Update();
ImageEnViewGreen.Update();
ImageEnViewBlue.Update();
... Modify the content of ImageEnViewRed, ImageEnViewGreen or ImageEnViewBlue
ImageEnView1.Proc.SetFromRGBChannels( ImageEnViewRed.IEBitmap, ImageEnViewGreen.IEBitmap, ImageEnViewBlue.IEBitmap );
Other Examples
// Load test image
ImageEnView1.IO.LoadFromFile( 'D:\TestImage.jpg' );

// Apply blurring to the blue color channel
bmpR := TIEBitmap.Create();
bmpG := TIEBitmap.Create();
bmpB := TIEBitmap.Create();
ImageEnView1.Proc.GetRGBChannel( bmpR, bmpG, bmpB );
bmpB.Proc.Blur( 10 );
ImageEnView1.Proc.SetFromRGBChannels( bmpR, bmpG, bmpB );
bmpR.Free;
bmpG.Free;
bmpB.Free;

// Flip the red channel vertically and the blue channel horizontally of an image
bmpR := TIEBitmap.Create();
bmpG := TIEBitmap.Create();
bmpB := TIEBitmap.Create();
ImageEnView1.Proc.GetRGBChannelAll( bmpR, bmpG, bmpB );
bmpR.Flip( fdVertical );
bmpB.Flip( fdHorizontal );
ImageEnView1.Proc.SetFromRGBChannels( bmpR, bmpG, bmpB );
bmpR.Free;
bmpG.Free;
bmpB.Free;
