为何我的pageControl的打印结果被缩小了?(50分)

  • 主题发起人 主题发起人 eversun
  • 开始时间 开始时间
E

eversun

Unregistered / Unconfirmed
GUEST, unregistred user!
我用下面的办法打印pagecontrol的当前页,但结果只有屏幕的1/10大小,为何?

if MessageDlg('Print this form?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then

with Printerdo

begin

begin
Doc;
PageControl1.Pages[0].PaintTo(Handle, 100, 900);
EndDoc;
end;
 
PrintScale试试其他值。。。
 
I've tried to change printscale, but same as before
 
打印时输出的大小应该根据打印机的分辨率调整
 
应该用 SetMapMode
然后用 SetWindowExtEx 、 SetViewportExtEx 指定逻辑点和物理点的比例
 
怎样用SetMapMode,SetWindowExtEx,SetViewportExtEx 指定逻辑点和物理点的比例? 能否举个例子?
 
not use paintto . try following code.
in this example, I use activeform to develop one application.
so if you use form,just use form1.print. (your form name is form1)

procedure TActiveFormX1.BitBtn17Click(Sender: TObject);
var
I, Start, Stop: Integer;
begin

PrintDialog1.Options := [poPageNums, poSelection];
PrintDialog1.FromPage := 1;
PrintDialog1.MinPage := 1;
PrintDialog1.ToPage := PageControl1.PageCount;
PrintDialog1.MaxPage := PageControl1.PageCount;
if PrintDialog1.Execute then

begin

{ determine the range the user wants to print }
with PrintDialog1do

begin

if PrintRange = prAllPages then

begin

Start := MinPage - 1;
Stop := MaxPage - 1;
end
else
if PrintRange = prSelection then

begin

Start := PageControl1.ActivePage.PageIndex;
Stop := Start;
end
else
{ PrintRange = prPageNums }
begin

Start := FromPage - 1;
Stop := ToPage - 1;
end;

end;

{ now, print the pages }
for I := Start to Stopdo

begin

PageControl1.ActivePageIndex:=I;
Self.Print;
end;

end;

end;


 
多人接受答案了。
 

Similar threads

后退
顶部