ImageEn, unit iexPdfiumCore

TPdfObject.PathFillMode

TPdfObject.PathFillMode


Declaration

property PathFillMode: TPdfFillMode;


Description

Specify whether a closed path is filled (pfAlternate or pfWinding) or not (pfNone).

Note: An object is closed if its path terminates with a Closing Break ($FFFEE)

Read/write


Examples

// Remove the fill from the current path
ImageEnView1.PdfViewer.Objects[idx].PathFillMode := pfNone;

// Which is the same as...
ImageEnView1.PdfViewer.Objects[idx].FillColor := TColor2TRGBA( clWhite, 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
PathStrokeWidth
StrokeColor
StrokeWidth