Xojo Conferences
MBSOct2019CologneDE

DynaPDF Manual - Page 140

Previous Page 139   Index   Next Page 141

Function Reference
Page 140 of 770
pdf.WriteTextA(0, 20 - h, #169);
pdf.SetFillColor(clBlack);
pdf.WriteTextA(cw +2, 20 - h, #168);
pdf.EndPattern;
pdf.ApplyPattern(pat, cmFill, 0);
pdf.SetPageCoords(pcTopDown);
pdf.DrawCircle(100, 160, 50, fmFillStroke);
pdf.DrawCircle(160, 60, 50, fmFillStroke);
pdf.DrawCircle(220, 160, 50, fmFillStroke);
pdf.Triangle(100, 160, 160, 60, 220, 160, fmFillStroke);
pdf.SetPageCoords(pcBottomUp);
// create an uncolored tiling pattern
pat := pdf.BeginPattern(ptUnColored, ttFastConstSpacing, 20, 20);
pdf.SetFontA('ZapfDingbats', fsNone, 12, false, cp1252);
h := pdf.GetAscent;
cw := pdf. GetTextWidthA(#171);
pdf.WriteTextA(0, 0, #171);
pdf.WriteTextA(cw +2, 0, #170);
pdf.WriteTextA(0, 20 - h, #169);
pdf.WriteTextA(cw +2, 20 - h, #168);
pdf.EndPattern;
pdf.SetPageCoords(pcTopDown);
// use the pattern as fill color with different colors
pdf.ApplyPattern(pat, cmFill, clGreen);
pdf.DrawCircle(350, 160, 50, fmFillStroke);
pdf.ApplyPattern(pat, cmFill, clBlue);
pdf.DrawCircle(410, 60, 50, fmFillStroke);
pdf.ApplyPattern(pat, cmFill, clRed);
pdf.DrawCircle(470, 160, 50, fmFillStroke);
pdf.ApplyPattern(pat, cmFill, clMaroon);
pdf.Triangle(350, 160, 410, 60, 470, 160, fmFillStroke);
pdf.EndPage;
pdf.CloseFile;
except
on E: Exception do MessageDlg(E.Message, mtError, [mbOK], 0);
end;
if pdf <> nil then pdf.Free;
end;
 

Previous topic: ApplyAppEvent, ApplyPattern

Next topic: ApplyShading