V***@gmail.com
2007-06-30 19:31:22 UTC
Does any expl to me this or give me some ideas
TMyDraw = class(TCustomControl)
TMyDraw.Paint
begin
inherited;
SetMapMode(Canvas.Handle, MM_LOMETRICS);
SetViewportOrgEx(Canvas.Handle, 0, ClientHeight);
R := Rect(0, 0, 1000, 1000);
with R do
Canvas.Rectangle(Left, Top, Right, Bottom);
InflateRect(R< -100, -100)
with R do
Canvas.Rectangle(Left, Top, Right, Bottom);
end;
- - - -
works fine when I put control on form in design mode and run program,
but when control is dynamic created in run - time mode
MyDraw := TMyDraw.Create(Self);
MyDraw.parent := Self;
etc etc ...
all is wrong. Square is 2x bigger and pen width 3x bigger.
TMyDraw = class(TCustomControl)
TMyDraw.Paint
begin
inherited;
SetMapMode(Canvas.Handle, MM_LOMETRICS);
SetViewportOrgEx(Canvas.Handle, 0, ClientHeight);
R := Rect(0, 0, 1000, 1000);
with R do
Canvas.Rectangle(Left, Top, Right, Bottom);
InflateRect(R< -100, -100)
with R do
Canvas.Rectangle(Left, Top, Right, Bottom);
end;
- - - -
works fine when I put control on form in design mode and run program,
but when control is dynamic created in run - time mode
MyDraw := TMyDraw.Create(Self);
MyDraw.parent := Self;
etc etc ...
all is wrong. Square is 2x bigger and pen width 3x bigger.