You are not logged in.
Pages: 1
Hi,
I have a strange problem with FillRect function. This is the code:
lPdf.VCLCanvas.Font.Name := fname;
lPdf.VCLCanvas.Font.Size := foSmall;
lPdf.VCLCanvas.Font.Style := [];
lPdf.VCLCanvas.Font.Color := clBlack;
lPdf.VCLCanvas.Pen.Width := 2;
lPdf.VCLCanvas.Pen.Color := clGray;
lPdf.VCLCanvas.Brush.Style := Vcl.Graphics.bsClear;
lPdf.VCLCanvas.Brush.Color := clRed;
rt := Rect(100, vpos, lPdf.VCLCanvasSize.cx-100, vpos +20);
lPdf.VCLCanvas.FillRect(rt);
lPdf.VCLCanvas.MoveTo(100, vpos);
lPdf.VCLCanvas.LineTo(100, vpos+20);
lPdf.VCLCanvas.MoveTo(100, vpos+20);
lPdf.VCLCanvas.LineTo(lPdf.VCLCanvasSize.cx-100, vpos+20);
This code draw 2 lines and a red fill rectangle. However I see only the fill rectangle. If I remove lPdf.VCLCanvas.FillRect(rt); from code I can see the lines.
I don't understand why? I should see the line over the fill rectangle.
Last edited by array81 (2014-03-03 13:04:46)
Offline
The same code works very well on TPaintBox canvas.
PaintBox1.Canvas.Pen.Width := 2;
PaintBox1.Canvas.Pen.Color := clGray;
PaintBox1.Canvas.Brush.Style := Vcl.Graphics.bsClear;
PaintBox1.Canvas.Brush.Color := clRed;
rt := Rect(100, 100, 200, 100 +20);
PaintBox1.Canvas.FillRect(rt);
PaintBox1.Canvas.MoveTo(100, 100);
PaintBox1.Canvas.LineTo(100, 100+20);
PaintBox1.Canvas.MoveTo(100, 100+20);
PaintBox1.Canvas.LineTo(200, 100+20);
Do you have any idea?
Offline
Pages: 1