Hi Andy
I personally find it easier to work with the alpha channel.
Here is an example of creating an image with a solid elliptical area and drawing that onto a white image.
var
bmp : TIEBitmap;
w, h: Integer;
begin
// Create a TIEBitmap with a solid elliptical image in centre
bmp := TIEBitmap.Create;
Try
bmp.read('D:\im.jpg');
// Calc Center
w := bmp.Width;
h := bmp.Height;
// Make canvas fully transparent
bmp.AlphaFill(0);
// Draw ellipse on alpha channel
with bmp.AlphaChannel.IECanvas do
begin
Pen.Style := psSolid;
Pen.Mode := pmCopy;
Pen.Color := clRed;
Brush.Style := bsSolid;
Ellipse( 0, 0, w, h );
end;
// Uncomment to see this image
// bmp.Write('D:\transparent.png');
// Create all white image in TImageEnView
ImageEnView1.IEBitmap.Allocate( w, h, clWhite, 255 );
// Draw our bitmap onto it
bmp.DrawToTIEBitmap( ImageEnView1.IEBitmap, 0, 0 );
// Refresh view
ImageEnView1.Update();
Finally
bmp.Free;
End;
Nigel
Xequte Software
www.imageen.com