ImageEn, unit iexPdfiumCore

TPdfObject.PathStrokeWidth

TPdfObject.PathStrokeWidth


Declaration

property PathStrokeWidth: Single;


Description

Returns the width of the current line (when ObjectType is ptPath).

Note: PathStrokeWidth is similar to StrokeWidth but it also checks whether the stroke is enabled (and returns 0 if not)

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 );

// Remove the border for the current path object
ImageEnView1.PdfViewer.Objects[idx].PathStrokeWidth := 0;

// 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
StrokeColor
StrokeWidth