ImageEn, unit iexPdfiumCore

TPdfObject.FillColor

TPdfObject.FillColor


Declaration

property FillColor: TRGBA;


Description

Specify the fill color for a path that is closed (when ObjectType is ptPath) and text.

Note:
Ensure you check whether the object is filled or not
An object is closed if its path terminates with a Closing Break ($FFFEE)

Read/write


Examples

// Fill the current path with Blue
ImageEnView1.PdfViewer.Objects[idx].FillColor := TColor2TRGBA( clBlue, 255 );

// Remove the fill from the current path
ImageEnView1.PdfViewer.Objects[idx].FillColor := TColor2TRGBA( clWhite, 0 );

// Which is the same as...
ImageEnView1.PdfViewer.Objects[idx].PathFillMode := pfNone;

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

GetPath
GetTextFont
LineCap
LineJoin
PathFillMode
PathStrokeWidth
StrokeColor
StrokeWidth
TColor2TRGBA