W
wxl82721
Unregistered / Unconfirmed
GUEST, unregistred user!
var
DMode: PDevMode;
h: THandle;
Device, Drive, Port: PChar;
OldLeft: Integer;
begin
with Printerdo
begin
Device := StrAlloc(255);
Drive := StrAlloc(255);
Port := StrAlloc(255);
GetPrinter(Device, Drive, Port, h);
DMode := LocalLock(h);
DMode.dmPaperSize := 256;
DMode.dmPaperLength := 2100;
DMode.dmPaperWidth := 2000;
LocalUnLock(h);
SetPrinter(Device, Drive, Port, h);
StrDispose(Device);
StrDispose(Drive);
StrDispose(Port);
begin
Doc;
OldLeft := MainPanel.Left;
MainPanel.Left := 1500;
try
MainPanel.ScaleBy(200, 100);
MainPanel.PaintTo(Handle, 30, 10);
MainPanel.ScaleBy(100, 200);
finally
MainPanel.Left := OldLeft;
end;
EndDoc;
end;
.................
end;
{
以上代码实现Panel中打印,用针式打印机可以打印正常,但用喷墨,激光打印机
打印出来的内容就非常小,不是针式打印机打印出来的实际尺寸,请大虾赐教,谢谢!
}
DMode: PDevMode;
h: THandle;
Device, Drive, Port: PChar;
OldLeft: Integer;
begin
with Printerdo
begin
Device := StrAlloc(255);
Drive := StrAlloc(255);
Port := StrAlloc(255);
GetPrinter(Device, Drive, Port, h);
DMode := LocalLock(h);
DMode.dmPaperSize := 256;
DMode.dmPaperLength := 2100;
DMode.dmPaperWidth := 2000;
LocalUnLock(h);
SetPrinter(Device, Drive, Port, h);
StrDispose(Device);
StrDispose(Drive);
StrDispose(Port);
begin
Doc;
OldLeft := MainPanel.Left;
MainPanel.Left := 1500;
try
MainPanel.ScaleBy(200, 100);
MainPanel.PaintTo(Handle, 30, 10);
MainPanel.ScaleBy(100, 200);
finally
MainPanel.Left := OldLeft;
end;
EndDoc;
end;
.................
end;
{
以上代码实现Panel中打印,用针式打印机可以打印正常,但用喷墨,激光打印机
打印出来的内容就非常小,不是针式打印机打印出来的实际尺寸,请大虾赐教,谢谢!
}