关于richedit的打印(50分)

  • 主题发起人 主题发起人 boot.ini
  • 开始时间 开始时间
B

boot.ini

Unregistered / Unconfirmed
GUEST, unregistred user!
在richedit中有一个打印文档的方法print
我想问一下,要怎么样才能设置print的打印参数
 
打印vRichEdit到一ACanvas的ARect上:
var
Range: TFormatRange;
OldMap: Integer;
begin
FillChar(Range, SizeOf(TFormatRange), 0);
with Rangedo
begin
hdc := ACanvas.Handle;
hdcTarget := hdc;
rc.left := ARect.Left * 1440 div REPORTDPI;
rc.top := ARect.Top * 1440 div REPORTDPI;
rc.right := ARect.Right * 1440 div REPORTDPI;
rc.bottom := ARect.Bottom * 1440 div REPORTDPI;
rcPage := ARect;
chrg.cpMax := -1;
OldMap := SetMapMode(hdc, MM_TEXT);
SendMessage(vRichEdit.Handle, EM_FORMATRANGE, 0, 0);
SendMessage(vRichEdit.Handle, EM_DISPLAYBAND, 0, Longint(@ARect));
try
chrg.cpMin := 0;
SendMessage(vRichEdit.Handle, EM_FORMATRANGE, 1, Longint(@Range));
finally
SendMessage(vRichEdit.Handle, EM_FORMATRANGE, 0, 0);
SetMapMode(hdc, OldMap);
end;
end;
vRichEdit.Free;
end;

才50分,太小气了,我好辛苦才在自己的项目中写出这方法的。你50小分就吃了,没天理!
 
不好意思,我只有50分,全部财产
 
后退
顶部