You are not logged in.
Pages: 1
Hi all,
I'm new to SynPDF and evaluating it for a new project. It's a very nice component and it fills all my need (outlines, jpg/bmp/png, annotations, bookmarks) except for the FloodFill procedure.
I can't get it to work.
procedure TForm1.Button1Click(Sender: TObject);
var filename:string;
lPdf:TPdfDocumentGDI;
lPage:TPdfPage;
begin
filename:='c:\temp\SynPDF.pdf';
lPdf:=TPdfDocumentGDI.Create();
try
lPdf.ScreenLogPixels:=600;
lPDF.DefaultPaperSize:=psA4;
lPage:=lPDF.AddPage;
lPDF.VCLCanvas.Pen.Color:=ClBlack;
lPDF.VCLCanvas.Pen.Width:=1;
lPDF.VCLCanvas.Pen.Style:=psSolid;
lPDF.VCLCanvas.Pen.Mode:=pmCopy;
lPDF.VCLCanvas.Brush.Color:=clYellow;
lPDF.VCLCanvas.Brush.Style:=bsSolid;
lPDF.VCLCanvas.MoveTo(400,400);
lPDF.VCLCanvas.lineto(600,800);
lPDF.VCLCanvas.lineto(200,800);
lPDF.VCLCanvas.lineto(400,400);
lPDF.VCLCanvas.FloodFill(500,700,ClBlack,fsBorder);
lPdf.SaveToFile(filename);
finally
lPdf.Free;
end;
ShellExecute(Handle, nil, PChar(filename), nil, nil, SW_SHOWNORMAL);
end;
Anyone have a clue what I'm doing wrong in the code to get that area filled? The lines are drawn as expected.
Offline
I have the same problem - Floodfill does nothing. I tried the FillRect method (having only rectangles to fill dynamically), but after a FillRect call, no other MoveTo followed by LineTo does produce any effect, whereas befor usage of FillRect, the drawn lines do appear correctly.
So, I tried to draw my grid first using MoveTo and LineTo sequences, which worked fine. But then, using FillRect to color the different rectangles appearantly override the rectangle borders when I display de PDF file with Acrobat reader (default resolution 47 %). Zoom into the page up to 800 % shows correct position of the colored rectangles, not overlapping any separation line.
So, my question is: how can I color an array type ordered sequence of rectangles (each of them may have a different color) ? I'm using SynPDF version 1.18, units directly integrated into a Delphi 6 Personal Edition DLL. I dont see any FillStroke method within VCLCanvas.
Last edited by Klaus (2020-11-09 08:53:34)
Offline
I found a Work-around... For each cell, i use the TextRec method to display a colored rectangle with a signe space as text, thus producing a pure color rectangle in the right place. After that, I trace all the required lines, around the table as well as the horizontal ane vertical lines. This way, the lines will show up, in the right places. And Zooming confirms the correct dimensins and positionning.
Offline
Pages: 1