http://www.efg2.com/Lab/Library/UseNet/1999/0714b.txt

From: "Nick Ryan" <nick@avatardesign.co.uk>
Subject: Re: D1 printing problem: incorrect font sizes
Date: 14 Jul 1999 00:00:00 GMT
Message-ID: <7mi4cp$2ot9@forums.borland.com>
References: <378C94B3.DFDF6FEB@bergsoft.de>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
Organization: Another Netscape Collabra Server User
X-MSMail-Priority: Normal
Newsgroups: borland.public.delphi.winapi,borland.public.delphi.objectpascal Daniel Berg (Berg Soft) <berg@bergsoft.de> wrote in message
news:378C94B3.DFDF6FEB@bergsoft.de...
> Hi there,
>
> I've got the following the following problem using D1 (on D2 and later
> the problem does not occur)
>
>
> I can select different printers with different resolutions from the
> printdialog.我可以从打印机对话框里 选相应不同分辨率的不同打印机。
> Printing to any printer works fine when the prog just started (i.e:
> Printing to Printer1, then shutdown prog, run again, then print to
> Printer 2 works perfect). 当程序刚启动时,打印到任何一个打印机都是正常的。比如打印到 打印机1,然后关闭程序。 再次运行,然后打印 到 打印机2,一起正常。
>
> Printing to a second printer AFTER printing to a first printer scales
> all fonts by
>
> Resolution(Printer1)/resolution(Printer2);
打印到第一个打印机后,(不关闭程序)直接再打印到第二个打印机时,缩放了所有的字体 以
第一个打印机 分辨率 / 第二个打印机分辨率 的比例。
>
> I have already tried the following without success:
>
> - Creation of the form that uses the printers unit at runtime AFTER
> printdialog.execute to create a new printer instance everytime
>
> - I have checked printers resolution with GetDeviceCaps: printer
> change is recognized correctly.
>
> Does anyone has an idea of whats wrong? It's some weird bug in Delphi's TPrinter that causes information to be
retained from a previous print session. (It affects the line thickness of
printing using D3). 这是打印机对象中的一些奇怪BUG。导致信息 从前一次打印会话中 保留。 The following code forces a complete refresh of the Printer object in D3 -
it *should* work in D1 as well... procedure ResetTPrinter;
var
APrinter:TPrinter;
begin
if (not Printer.Printing) then begin
APrinter := SetPrinter(NIL);
if (APrinter <> NIL) then APrinter.Free;
end; {if}
end;
//我看新版的VCL源代码里直接 一行代码 就行了 SetPrinter(nil).Free; Nick

重置delphi Printer对象的更多相关文章

  1. 多线程的基本概念和Delphi线程对象Tthread介绍

    多线程的基本概念和Delphi线程对象Tthread介绍 作者:xiaoru    WIN 98/NT/2000/XP是个多任务操作系统,也就是:一个进程可以划分为多个线程,每个线程轮流占用CPU运行 ...

  2. delphi:临界区对象TCriticalSection(Delphi) 与 TRtlCriticalSection 的区别

    临界区对象TCriticalSection(Delphi) 与 TRtlCriticalSection 的区别 TRtlCriticalSection 是一个结构体,在windows单元中定义: 是I ...

  3. Delphi 绘图对象

    来自:http://blog.csdn.net/lailai186/article/details/8755430 ========================================== ...

  4. Delphi栈对象

    来自:http://blog.csdn.net/iseekcode/article/details/5158985 ------------------------------------------ ...

  5. Delphi GDI对象之绘制位图

    http://www.cnblogs.com/pchmonster/archive/2012/07/06/2579334.html 绘制位图(Drawing Bitmaps) 绘制位图听起来似乎很难, ...

  6. Delphi中流对象的应用

    Delphi的流对象(TStream的派生对象)有如下读写函数: function Read(var Buffer; Count: Longint): Longint;function Write(c ...

  7. Delphi的对象注销方法Destroy和free

    当您使用完对象后,您应该及时撤销它,以便把这个对象占用的内存释放出来.您可以通过调用一个注销方法来撤销您的对象,它会释放分配给这个对象的内存. Delphi的注销方法有两个:Destroy和Free. ...

  8. Delphi - 互斥对象下实现系统的单例模式

    使用CreateMutex函数创建互斥对象 利用Windows系统函数CreateMutex(),找出当前系统是否已经存在指定进程的实例,如果没有则创建一个互斥体. CreateMutex函数原型如下 ...

  9. Delphi COM对象

    作者:巴哈姆特  http://www.cnpack.org(转载请注明出处并保持完整) 如果没有接触过COM对象的话,你会觉得接口真的很麻烦,也许会有:“还不如直接定义一个类更方便”的想法. 的确, ...

随机推荐

  1. kubernetes 命令记录

    操作基本命令:   通过yaml文件创建: kubectl create -f xxx.yaml (不建议使用,无法更新,必须先delete) kubectl apply -f xxx.yaml (创 ...

  2. 【Hostname】Linux修改主机名称

    环境:CentOS 6.5 方式一: 1.修改hosts文件 vi /etc/hosts 将本机ip地址后面的hostname改掉 2.修改network文件 vi /etc/sysconfig/ne ...

  3. java中常量接口及实现常量接口的利与弊

    在所做的项目中,将程序中很多要用的常量放置在ServiceConstants的接口中,称其为常量接口,只要实现该接口,就可以 在项目中直接使用常量接口中的常量,通过上网搜索之后,将很好的两篇博客链接储 ...

  4. 04_Windows平台Spark开发环境构建

    Spark的开发环境,可以基于IDEA+Scala插件,最终将打包得到的jar文件放入Linux服务器上的Spark上运行 如果是Python的小伙伴,可以在Windows上部署spark+hadoo ...

  5. UVa 1620 懒惰的苏珊(逆序数)

    https://vjudge.net/problem/UVA-1620 题意:给出一个序列,每次可以翻转4个连续的数,判断是否可以变成1,2,3...n. 思路:考虑逆序数,通过计算可以得出每次翻转4 ...

  6. java命令行执行程序解决依赖外部jar包的问题

    用java命令行直接执行程序,如果这个程序需要引用外部jar包.就不能单纯用java xx来执行 如果你的jar包和程序就在一个目录: 编译 javac -cp D:\yy\yy.jar,D\xx\x ...

  7. spoj TBATTLE 质因数分解+二分

    题目链接:点击传送 TBATTLE - Thor vs Frost Giants #number-theory #sliding-window-1 Thor is caught up in a fie ...

  8. hdu 2824 The Euler function 欧拉函数打表

    The Euler function Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Other ...

  9. 机器学习 MLIA学习笔记(三)之 KNN(二) Dating可能性实例

    这是个KNN算法的另一实例,计算Dating的可能性. import numpy as np import os import operator import matplotlib import ma ...

  10. python获取文件扩展名的方法

    主要介绍了python获取文件扩展名的方法,涉及Python针对文件路径的相关操作技巧 import os.path def file_extension(path): ] print file_ex ...