Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-06

Canvas size mismatch with control size

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Xiangrong Fang

Hi,

I found that on Windows platform, Canvas size may mismatch with control's size. See the following code:

procedure TForm1.FormPaint(Sender: TObject);
begin
  Caption := Format('Form=%d:%d, Canvas=%d:%d', [Width, Height,
Canvas.Width, Canvas.Height]);
end;

Run this code on Windows, I found that when the form is enlarged, the 2 sizes matches, but when the form shrinks Canvas' size is always the largest value it has been.

-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120605/46c557c2/attachment.html>

Reply by email