看看 SetMapMode(Canvas.Handle, MM_HIMETRIC); SetViewportOrgEx(Canvas.Handle, 300, 200, nil); 是不是你要的The MM_HIMETRIC map mode uses the same axes orientation as the above three modes. Its units are gotten by multiplying each of the given units by 0.01 millimeter. Here is an example:
SetMapMode(Canvas.Handle, MM_HIMETRIC);
SetViewportOrgEx(Canvas.Handle, 300, 200, nil);
是不是你要的The MM_HIMETRIC map mode uses the same axes orientation as the above three modes. Its units are gotten by multiplying each of the given units by 0.01 millimeter. Here is an example:
procedure TForm1.FormPaint(Sender: TObject);
begin
SetMapMode(Canvas.Handle, MM_HIMETRIC);
SetViewportOrgEx(Canvas.Handle, 300, 200, nil); Canvas.Pen.Color := clRed;
Canvas.Ellipse(-100, -100, 100, 100); Canvas.Pen.Color := clBlue;
Canvas.MoveTo(-300, 0);
Canvas.LineTo(300, 0);
Canvas.MoveTo(0, -200);
Canvas.LineTo(0, 200); Canvas.Pen.Color := clFuchsia;
Canvas.MoveTo(0, 0);
Canvas.LineTo(150, 150);
end;
它与分辨率好象没有关系哦。你的意思是不是控件左边留2厘米的边距,在分辨率改变的情况下看起来是一样的?