ImageEn, unit iegdiplus

TIECanvas.DrawLines

TIECanvas.DrawLines


Declaration

procedure DrawLines(Lines: TList; LineColor: TColor = clNone; LineWidth: Integer = -1; LineStyle: TIEGPPenStyle = iegpSolid); overload;
procedure DrawLines(Lines: TIEVisionVectorScalarInt32; LineColor: TColor = clNone; LineWidth: Integer = -1; LineStyle: TIEGPPenStyle = iegpSolid); overload;


Description

Draw a list of lines to the canvas.

Lines can be one of:
A TList of TRects where line is drawn from Top-Left to Bottom-Right
A TIEVisionVectorScalarInt32 object, e.g. from IEVision methods like detectLines and houghLinesP

You can optionally specify a line color, width and style (if you have not already specified these using Pen).




Examples

lines := ImageEnView1.IEBitmap.GetIEVisionImage().detectLines( ievLSDDetector );
ImageEnView1.IEBitmap.IECanvas.DrawLines( lines, clRed, 2 );
ImageEnView1.Proc.TextOut( Align_Text_Near_Left, Align_Text_Near_Top, Format( 'Lines: %d', [ lines.size ]), 'Arial', 12, Text_Color, [fsBold] );
ImageEnView1.Update();




// Draw a multiple diagonal lines
var
  lines: TList;
  r: PRect;
  i: Integer;
begin
  lines := TList.Create;
  for i := 1 to 4 do
  begin
    new( r );
    r^.Left   := 100;
    r^.Top    := i * 50;
    r^.Right  := 200;
    r^.Bottom := i * 50 + 100;
    lines.Add( r );
  end;
  ImageEnView1.IEBitmap.IECanvas.DrawLines( lines, clRed, 2 );
  ImageEnView1.Update();
  for i := 0 to lines.Count - 1 do
    dispose( PRect( lines[i] ));
  lines.free();
end;