ImageEn, unit iexPdfiumCore

TPdfObject.StrokeColor

TPdfObject.StrokeColor


Declaration

property StrokeColor: TRGBA;


Description

Specifies the color of the line (when ObjectType is ptPath).

Read/write


Examples

// Set a thick red border for the current path object
ImageEnView1.PdfViewer.Objects[idx].PathStrokeWidth := 5;
ImageEnView1.PdfViewer.Objects[idx].StrokeColor := TColor2TRGBA( clRed, 255 );


// Add a spot wherever user clicks on a PDF page
procedure TfrmMain.ImageEnView1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
const
  Spot_Size         = 20;
  Spot_Border_Color = clBlack;
  Spot_Border_Size  = 2;
  Spot_Fill_Color   = clRed;
  Spot_Opacity      = 255;
var
  clickPos: TDPoint;
  obj: TPdfObject;
begin
  clickPos := ImageEnView1.PdfViewer.ScrToPage( X, Y, True );

  // Center ellipse over click position
  obj := ImageEnView1.PdfViewer.Objects.AddEllipse( clickPos.X - Spot_Size div 2, clickPos.Y - Spot_Size div 2, Spot_Size, Spot_Size );

  obj.StrokeColor := TColor2TRGBA( Spot_Border_Color, Spot_Opacity );
  obj.PathStrokeWidth := Spot_Border_Size;
  obj.FillColor := TColor2TRGBA( Spot_Fill_Color, Spot_Opacity );
  obj.PathFillMode := pfAlternate; // Ensure path is filled
end;


See Also

FillColor
GetPath
GetTextFont
LineCap
LineJoin
PathFillMode
PathStrokeWidth
StrokeWidth
TColor2TRGBA