U
uniworldus
Unregistered / Unconfirmed
GUEST, unregistred user!
我在一个打印程序中使用了
setwindowext(handle,dpi,dpi);
但总报警:
[Error] print_file.pas(52): E2003 Undeclared identifier: 'setwindowext'
请问哪位高手能指点迷津:)
下面是我参照的程序:
——————————————————————————————————
http://www.richsearch.com/search/displ.aspx?lid=727554
********************************************************************
RE: 如何使屏幕内容与报表内容一致?
ID=727554, 发贴富翁: Kingron, 发贴时间:2001-11-13 2:29:00不知道你是怎么解决的,刚好找到到了一些资料,就是我以前所的那个函数:
如何在不同的打印分辨率下面打印?
下面给出一个函数,在调用这个函数之后,你就可以使用Font.Size来设置字体的大小而与打印机分辨率无关了。
注意必须在Printer.begin
Doc之后调用这个函数!
{-------------------------------------------------------------
Sets the logicaldo
ts per inch for the printer and sets the printer axes to point RIGHT anddo
WN. Thus (0,0) is at the top left corner of the page. Returns the page size in logical coordinates.
Note: Must be called AFTER Printer.begin
Doc.
--------------------------------------------------------------}
function SetPrinterScale(dpi : integer) : TPoint;
var
DeviceDpiX, DeviceDpiY : integer;
begin
with Printerdo
begin
SetMapMode(Handle, MM_ISOTROPIC);
SetWindowExt(Handle, dpi, dpi);
DeviceDpiX := GetDeviceCaps(Handle, LOGPIXELSX);
DeviceDpiY := GetDeviceCaps(Handle, LOGPIXELSY);
SetViewPortExt(Handle, DeviceDpiX, DeviceDpiY);
Result := Point(PageWidth, PageHeight);
with Canvasdo
begin
DPtoLP(Handle, Result, 1);
{ This API call is required... }
Font.PixelsPerInch := DPI;
{ ...to make this work. (Who knows why?) }
end;
end;
end;
setwindowext(handle,dpi,dpi);
但总报警:
[Error] print_file.pas(52): E2003 Undeclared identifier: 'setwindowext'
请问哪位高手能指点迷津:)
下面是我参照的程序:
——————————————————————————————————
http://www.richsearch.com/search/displ.aspx?lid=727554
********************************************************************
RE: 如何使屏幕内容与报表内容一致?
ID=727554, 发贴富翁: Kingron, 发贴时间:2001-11-13 2:29:00不知道你是怎么解决的,刚好找到到了一些资料,就是我以前所的那个函数:
如何在不同的打印分辨率下面打印?
下面给出一个函数,在调用这个函数之后,你就可以使用Font.Size来设置字体的大小而与打印机分辨率无关了。
注意必须在Printer.begin
Doc之后调用这个函数!
{-------------------------------------------------------------
Sets the logicaldo
ts per inch for the printer and sets the printer axes to point RIGHT anddo
WN. Thus (0,0) is at the top left corner of the page. Returns the page size in logical coordinates.
Note: Must be called AFTER Printer.begin
Doc.
--------------------------------------------------------------}
function SetPrinterScale(dpi : integer) : TPoint;
var
DeviceDpiX, DeviceDpiY : integer;
begin
with Printerdo
begin
SetMapMode(Handle, MM_ISOTROPIC);
SetWindowExt(Handle, dpi, dpi);
DeviceDpiX := GetDeviceCaps(Handle, LOGPIXELSX);
DeviceDpiY := GetDeviceCaps(Handle, LOGPIXELSY);
SetViewPortExt(Handle, DeviceDpiX, DeviceDpiY);
Result := Point(PageWidth, PageHeight);
with Canvasdo
begin
DPtoLP(Handle, Result, 1);
{ This API call is required... }
Font.PixelsPerInch := DPI;
{ ...to make this work. (Who knows why?) }
end;
end;
end;