ImageEn, unit iexBitmaps

TIEBitmap.IECanvas

TIEBitmap.IECanvas


Declaration

property IECanvas: TIECanvas;


Description

Returns the IECanvas when Location is ieTBitmap.
If the bitmap is attached to a TImageEnView, ensure that you call Update after drawing to the canvas.

Note: If you access the IECanvas property the Location is automatically converted to ieTBitmap.

See also: Canvas


Example

// Draw an anti-aliased ellipse onto a TIEBitmap
with iebmp.IECanvas do
begin
  Pen.Style := psSolid;
  Pen.Mode  := pmCopy;
  Pen.Color := clRed;
  Brush.Style := bsClear
  Ellipse( Rect( 100, 100, 200, 200 ));
end;

// Highlight an area of an image
ImageEnView1.IEBitmap.IECanvas.Brush.Color := clYellow;
ImageEnView1.IEBitmap.IECanvas.Brush.Style := bsSolid;
ImageEnView1.IEBitmap.IECanvas.Brush.Transparency := 125;
ImageEnView1.IEBitmap.IECanvas.FillRect( Rect( 100, 100, 300, 300 );
ImageEnView1.Update();


Example 2

// Create a shaped image, by drawing a letter to the canvas of the Alpha channel
ImageEnView1.IO.LoadFromFile( 'D:\Testing_Multimedia\Sub-100KB\Sunset 2.jpg' );
ImageEnView1.IEBitmap.AlphaChannel.Fill( clBlack );
ImageEnView1.IEBitmap.AlphaChannel.IECanvas.Font.Height := ImageEnView1.IEBitmap.Height;
ImageEnView1.IEBitmap.AlphaChannel.IECanvas.Font.Style  := [fsBold];
ImageEnView1.IEBitmap.AlphaChannel.IECanvas.Font.Color  := clWhite;
ImageEnView1.IEBitmap.AlphaChannel.IECanvas.DrawText( 'Q', Rect( 0, 0, ImageEnView1.IEBitmap.Width, ImageEnView1.IEBitmap.Height ), iejCenter );
ImageEnView1.Update();