亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? printer.htm

?? 對于學習很有幫助
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
<!-- This document was created with HomeSite v2.5 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">

<HTML>
<HEAD>
	<TITLE>UDDF - Printer</TITLE>
	<META NAME="Description" CONTENT="Printer section of the Delphi Developers FAQ" >
	<META NAME="KeyWords" CONTENT="" >

</HEAD>

<BODY bgcolor="#FFFFFF">
<CENTER>
<IMG SRC="../images/uddf.jpg"> </CENTER>
<HR SIZE="6" color="#00FF00">


<CENTER><FONT SIZE="7" FACE="Arial Black" COLOR="RED">Printer</FONT></CENTER>
<P><H1><A NAME="printer0">Help on Printer Control Codes</P></A></H1>
<P><I>From: dblock@vdn.com (David Block)</I></P>

<PRE>Vincent Lim &lt;kaneda@singnet.com.sg&gt; wrote:

How do I send Printer Control Codes to the printer without having them
translated into unprintable characters?
Not sure if it is Windows API or Delphi is the culprit.
When I write the printer control codes, they are just printed as
unprintable characters rather than being interpreted by the printer.
</PRE>

You need to use the Passthrough printer Escape function to send data
directly to the printer. If you're using WriteLn, then it won't work.
Here's some code to get you started:
<P>
<HR><PRE>unit Passthru;

interface

uses printers, WinProcs, WinTypes, SysUtils;

Procedure       PrintTest;

implementation

Type
        TPassThroughData = Record
                nLen : Integer;
                Data : Array[0..255] of byte;
        end;

Procedure DirectPrint(s : String);
var
        PTBlock : TPassThroughData;
Begin
        PTBlock.nLen := Length(s);
        StrPCopy(@PTBlock.Data,s);
        Escape(printer.handle, PASSTHROUGH,0,@PTBlock,nil);
End;



Procedure PrintTest;
Begin
        Printer.BeginDoc;
        DirectPrint(CHR(27)+'&amp;l1O'+'Hello, World!');
        Printer.EndDoc;
End;


end.
</PRE><HR>

<P><H1><A NAME="printer1">How to get Paper Source?</P></A></H1>
<P><I> 'Joe C. Hecht' &lt;jhecht@wpo.borland.com&gt;</I></P>


<P>Below are some code snippets to change the printer settings. Wherever the changes are made, you could instead examine the printer settings. 
See the documentation for  ExtDeviceMode and the TDEVMODE structure as well the printer escape GETSETPAPERBINS and GetDeviceCaps().</P>

*********************************************
<P>One way to change printer settings at the start of a print job is to change the printers devicemode.</P>

<P>Example:</P>

<HR><PRE>var
Device : array[0..255] of char;
Driver : array[0..255] of char;
Port   : array[0..255] of char;
hDMode : THandle;
PDMode : PDEVMODE;
begin
  Printer.PrinterIndex := Printer.PrinterIndex;
  Printer.GetPrinter(Device, Driver, Port, hDMode);
  if hDMode &lt;&gt; 0 then begin
    pDMode := GlobalLock(hDMode);
    if pDMode &lt;&gt; nil then begin
      pDMode^.dmFields := pDMode^.dmFields or DM_COPIES;
      pDMode^.dmCopies := 5;
      GlobalUnlock(hDMode);
    end;
    GlobalFree(hDMode);
  end;
  Printer.PrinterIndex := Printer.PrinterIndex;
  Printer.BeginDoc;
  Printer.Canvas.TextOut(100,100, 'Test 1');
  Printer.EndDoc;
</PRE><HR>

<P>Another way is to change TPrinter.
This will enable you to change settings in mid job. 
You must make the change &gt;&gt;&gt;between&lt;&lt;&lt; pages.</P>

<P>To do this:</P>

<P>Before every startpage() command in printers.pas in the Source\VCL directory add something like:</P>

<HR><PRE> DevMode.dmPaperSize:=DMPAPER_LEGAL
{any other devicemode settings go here}
 Windows.ResetDc(dc,Devmode^);
</PRE><HR>

<P>This will reset the pagesize. you can look up DEVMODE in the help to find other paper sizes.</P>

<P>You will need to rebuild the vcl source for this to work, by adding the path to the VCL source directory to the beginning of the library path s
tatement under tools..options.. library...libaray path. Quit Delphi then do a build all.</P>

<P><B>Another quick note...</B></P>

<P>When changing printers, be aware that fontsizes may not always scale properly. To ensure proper scaling set the PixelsPerInch property of the font.</P>

<P>Here are two examples:</P>

<HR><PRE>uses Printers;

var
  MyFile: TextFile;
begin
  AssignPrn(MyFile);
  Rewrite(MyFile);

  Printer.Canvas.Font.Name := 'Courier New';
  Printer.Canvas.Font.Style := [fsBold];
  Printer.Canvas.Font.PixelsPerInch:=
    GetDeviceCaps(Printer.Canvas.Handle, LOGPIXELSY);

  Writeln(MyFile, 'Print this text');

  System.CloseFile(MyFile);
end;
</PRE><HR>

<HR><PRE>uses Printers;

begin
  Printer.BeginDoc;
  Printer.Canvas.Font.Name := 'Courier New';
  Printer.Canvas.Font.Style := [fsBold];

  Printer.Canvas.Font.PixelsPerInch:=
    GetDeviceCaps(Printer.Canvas.Handle, LOGPIXELSY);

  Printer.Canvas.Textout(10, 10, 'Print this text');

  Printer.EndDoc;
end;
</PRE><HR>

<P><H1><A NAME="printer2">How to Print VERTICAL oriented text in Delphi</P></A></H1>
<P><I>From: "Peter Szymiczek" &lt;szymicpe@bmw.com.au&gt;</I></P>

<HR><PRE>procedure AngleTextOut(CV: TCanvas; const sText: String; x, y, angle:integer);
var
  LogFont: TLogFont;
  SaveFont: TFont;
begin
  SaveFont := TFont.Create;
  SaveFont.Assign(CV.Font);
  GetObject(SaveFont.Handle, sizeof(TLogFont), @LogFont);
  with LogFont do
    begin
      lfEscapement := angle *10;
      lfPitchAndFamily := FIXED_PITCH or FF_DONTCARE;
    end; {with}
  CV.Font.Handle := CreateFontIndirect(LogFont);
  SetBkMode(CV.Handle, TRANSPARENT);
  CV.TextOut(x, y, sText);
  CV.Font.Assign(SaveFont);
  SaveFont.Free;
end;
</PRE><HR>


<P><H1><A NAME="printer3">Help - Printing sideways text...</P></A></H1>
<P><I>From: Jukka Palom&auml;ki &lt;jukpalom@utu.fi&gt;</I></P>

<P>This is how I have solved the problem:</P>

<HR><PRE>procedure TextOutVertical(var bitmap: TBitmap; x, y: Integer; s: String);
var b1, b2: TBitmap;
    i, j: Integer;
begin
  with bitmap.Canvas do
  begin
    b1 := TBitmap.Create;
    b1.Canvas.Font := lpYhFont;
    b1.Width  := TextWidth(s) + 1;
    b1.Height := TextHeight(s) + 1;
    b1.Canvas.TextOut(1, 1, s);

    b2 := TPackedBitmap.Create;
    b2.Width  := TextHeight(s);
    b2.Height := TextWidth(s);
    for i := 0 to b1.Width - 1 do
        for j := 0 to b1.Height do
            b2.Canvas.Pixels[j, b2.Height + 1 - i] := b1.Canvas.Pixels[i, j];
    Draw(x, y, b2);
    b1.Free;
    b2.Free;
  end
end;
</PRE><HR>

<P><H1><A NAME="printer4">How to print a bitmap?</P></A></H1>
<P>Use the following code.  Remember to include the Printers unit in the uses clause :</P>

<P>Lines followed by // ** are essential.  The others are to get the scaling correct otherwise you end up with extremely small images. 
 Printer resolutions are higher than your screen resolution.</P>

<HR><PRE>procedure TForm1.Button1Click(Sender: TObject);
var
  ScaleX, ScaleY: Integer;
  R: TRect;
begin
  Printer.BeginDoc;  // **
  with Printer do
  try
    ScaleX := GetDeviceCaps(Handle, logPixelsX) div PixelsPerInch;
    ScaleY := GetDeviceCaps(Handle, logPixelsY) div PixelsPerInch;
    R := Rect(0, 0, Image1.Picture.Width * ScaleX,
      Image1.Picture.Height * ScaleY);
    Canvas.StretchDraw(R, Image1.Picture.Graphic);  // **
  finally
    EndDoc;  // **
  end;
end;
</PRE><HR>

<P><H1><A NAME="printer5">Hack: tired of ReportSmith?  Wish you had wysiwyg reports?</P></A></H1>
<P><I>From: "James D. Rofkar" &lt;jim_rofkar%lotusnotes1@instinet.com></I></P>

<P>For those of you who are sick and tired of mucking around with ReportSmith, only to find limitations, drawbacks, etc.  
And have grown tired of trying to find that perfect WYSIWYG report generator.</P>

<P>Well...</P>

<P>Chances are you've got a good one already.  It's called MS-Word! That's right!  Use Word for report generation.  
It's actually quite easy with OLE Automation.  I know that word (OLE) scares some of you, but check-out this code:</P>

<HR><PRE>  var
     Word: Variant;
  begin
     Word := CreateOleObject('Word.Basic');
     with Word do
        begin {Pure WordBASIC commands follow...}
        FileNew('Normal');
        Insert('This is the first line'#13);
        Insert('This is the second line'#13);
        FileSaveAs('c:\temp\test.txt', 3);
        end;
  end;
</PRE><HR>
<P>Simple, isn't it?  If you notice, there's no need for SendMessage(), or PostMessage(), or DDE, or Word's C-API, or some proprietary  
DOS-based batch programming that requires text files to be  written.  In fact, none of that junk!</P>

<P>Another benefit of OLE Automation is that it doesn't require the darned app to launch.  That's right!  Word does not show-up using this technique. 
 Instead, just the WordBASIC engine is used.  The speed improvements and lower memory footprint kick the livin' crap out of the techniques listed in the previous paragraph.</P>

<P>A wild side-benefit is that if you startup Word while your program is using OLE Automation, you can watch it work.  
Yup!  Word realizes that "documents" are opened and being editing, and hence, displays them like regular old Word documents.</P>

<P>Now all you need to do is generate a Word template with Bookmarks! Then, using the WordBASIC commands "EditBookmark .Goto" and "Insert",  you're ready to rock!</P>

<P>I've given-up on report generators.  They suck compared to Word's WYSIWYG output!</P>

<P>- Jim Rofkar.</P>

<P>P.S. - If you use this technique, try to incorporate my name somewhere in your source comments.  Thanks.  I'll return the favor if I use one of your cool hacks!</P>

<P><H1><A NAME="printer6">Dump a text file</P></A></H1>
<P><I>From: Chris Monson &lt;ckmonson@burgoyne.com></I></P>

<P>Use CreateFile to get a handle to LPT1</P>

<HR><PRE>  LPTHandle := CreateFile( 'LPT1',GENERIC_WRITE,
                 0, PSecurityAttributes(nil),
                 OPEN_EXISTING, FILE_FLAG_OVERLAPPED,
                 0);
</PRE><HR>

<P>Then use WriteFile to send a string of characters or use</P>

<HR><PRE>  While not
    TransmitCommChar( LPTHandle, CharToSend ) do
  Application.ProcessMessages;
</PRE><HR>

<P>It sends one raw character at a time to the parallel port.  It waits for
the recent character to get processed and then immediately sends a new
one.  I got it printing stuff pretty fast.</P>

<P><H1><A NAME="printer7">Printing a line at a time</P></A></H1>
<P><I>From:             Peter van Lonkhuyzen &lt;peterv@lin01.global.co.za></I></P>

<PRE>> I've tried to write a D1 or D2 program that will print only one line at a time to a printer (any type), exit the program but NOT eject the page, 
so that the next time I run the program and it prints a line, it prints on the very next line, etc.</PRE>

<P>According to M$ this is illegal as it "defeats the multitasking nature"  but I needed the same functionality.</P>

<P>I created the following derivative of the TPrinter object. It works perfectly on dotmatrix printers.</P>

<P>sample usage</P>

<HR><PRE>var Myprinter : TRawPrinter;
    oldprinter : TPrinter;
begin
 MyPrinter:=TRawPrinter.Create;
 oldprinter:=setprinter(MyPrinter);
 try
  if Printdialog1.execute then
  begin
    myprinter.startraw;
    myprinter.write('khsdhskhkshdksd');
    myprinter.writeln;
    myprinter.endraw;
  end
 finally
  setprinter(oldprinyter);
  myprinter.free;
 end
end;
</PRE><HR>

<P>Here is the code for the raw printer object.</P>

<HR><PRE>unit Rawprinter;

interface
uses printers,windows;

type TRawprinter =class(TPrinter)
                  public
                    dc2 : HDC;
                    procedure startraw;
                    procedure endraw;
                    procedure write(const s : string);
                    procedure writeln;
                  end;

implementation
uses sysutils,forms;

function AbortProc(Prn: HDC; Error: Integer): Bool; stdcall;
begin
  Application.ProcessMessages;
  Result := not Printer.Aborted;
end;

type
  TPrinterDevice = class
    Driver, Device, Port: String;
    constructor Create(ADriver, ADevice, APort: PChar);
    function IsEqual(ADriver, ADevice, APort: PChar): Boolean;
  end;

constructor TPrinterDevice.Create(ADriver, ADevice, APort: PChar);
begin
  inherited Create;
  Driver := ADriver;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美激情四射| 91小视频在线观看| 欧美一级高清大全免费观看| 天天色 色综合| 精品少妇一区二区三区在线视频| 免费不卡在线视频| 国产亚洲一区二区三区在线观看| 成人不卡免费av| 樱花草国产18久久久久| 欧美裸体bbwbbwbbw| 精品在线一区二区三区| 国产欧美一区二区在线观看| av电影天堂一区二区在线| 亚洲另类色综合网站| 4438x成人网最大色成网站| 伦理电影国产精品| 国产精品久久久久久久久快鸭 | 欧美在线视频全部完| 亚洲成人福利片| 欧美岛国在线观看| 成人黄色av电影| 亚洲成人手机在线| 久久久国产精品麻豆| 在线观看区一区二| 国产麻豆欧美日韩一区| 一区二区三区在线视频观看| 国产精品丝袜一区| 欧美色老头old∨ideo| 黄色小说综合网站| 综合激情成人伊人| 日韩一区二区三区电影在线观看 | 天天影视涩香欲综合网 | 91麻豆国产精品久久| 亚洲大片在线观看| 中文字幕av不卡| 日韩欧美一区中文| 色综合视频在线观看| 激情欧美一区二区三区在线观看| 亚洲视频在线观看一区| 精品国产污网站| 欧洲一区在线电影| 高清beeg欧美| 精彩视频一区二区三区| 亚洲国产综合色| 国产精品美女久久久久aⅴ国产馆| 91在线你懂得| 日韩国产欧美在线播放| 欧美经典一区二区| 在线播放日韩导航| 99精品久久只有精品| 久久福利资源站| 日韩精品一级中文字幕精品视频免费观看 | 一色屋精品亚洲香蕉网站| 日韩免费观看2025年上映的电影 | eeuss鲁片一区二区三区在线观看| 日本亚洲三级在线| 亚洲国产美女搞黄色| 国产精品久久久久久久久久久免费看 | 国产一区 二区 三区一级| 五月天中文字幕一区二区| 中文字幕在线免费不卡| 久久九九国产精品| 欧美大肚乱孕交hd孕妇| 91麻豆精品国产91久久久久久久久 | 亚洲激情自拍视频| 亚洲日本va午夜在线影院| 国产精品视频yy9299一区| 337p粉嫩大胆噜噜噜噜噜91av | 精品国产1区二区| 欧美人与性动xxxx| 在线一区二区三区四区五区| 成人午夜免费av| 国产**成人网毛片九色 | 日韩一区二区在线观看视频| 欧美午夜精品久久久久久孕妇| 暴力调教一区二区三区| 成人av电影免费观看| 成人黄色在线视频| 9l国产精品久久久久麻豆| 91影院在线观看| 欧美在线观看一区| 91 com成人网| 26uuu成人网一区二区三区| 久久精品夜色噜噜亚洲aⅴ| 久久久久久久久久久黄色| 亚洲国产精品成人久久综合一区| 欧美激情一区二区三区全黄| 中文字幕亚洲区| 亚洲综合色视频| 视频一区欧美日韩| 精品中文av资源站在线观看| 国产1区2区3区精品美女| 91在线无精精品入口| 欧美中文字幕一二三区视频| 欧美一区二区三区精品| 精品国产乱码久久久久久久久| 久久久久久久av麻豆果冻| 亚洲欧洲精品一区二区三区不卡| 亚洲一区二区综合| 久久精品国产999大香线蕉| 国产91富婆露脸刺激对白| 色香色香欲天天天影视综合网| 欧美视频一区在线| 精品福利一区二区三区免费视频| 国产精品欧美一区喷水| 亚洲永久免费av| 久草中文综合在线| av在线这里只有精品| 777午夜精品免费视频| 26uuu国产日韩综合| 玉米视频成人免费看| 狠狠久久亚洲欧美| 91蜜桃免费观看视频| 日韩一区二区精品葵司在线| 国产精品丝袜一区| 奇米一区二区三区av| 99精品在线观看视频| 欧美一区二区人人喊爽| 国产精品国产三级国产三级人妇| 丝袜诱惑亚洲看片| 成人午夜视频在线| 日韩视频一区二区三区| 亚洲精品中文字幕乱码三区| 卡一卡二国产精品| 日本韩国视频一区二区| 2024国产精品| 亚洲1区2区3区4区| 成人妖精视频yjsp地址| 日韩午夜激情av| 亚洲视频网在线直播| 国产曰批免费观看久久久| 欧美午夜精品电影| 国产精品青草久久| 精品伊人久久久久7777人| 在线免费观看日韩欧美| 国产精品毛片高清在线完整版| 久久国产综合精品| 欧美最猛性xxxxx直播| 中文乱码免费一区二区| 激情六月婷婷久久| 欧美一区二区三区色| 亚洲精品久久7777| av在线不卡免费看| 欧美激情综合五月色丁香 | 午夜一区二区三区视频| 97久久超碰精品国产| 久久嫩草精品久久久久| 蜜桃一区二区三区四区| 欧美亚洲动漫精品| 亚洲欧美日韩久久| 9人人澡人人爽人人精品| 国产女主播在线一区二区| 国产一本一道久久香蕉| 日韩精品资源二区在线| 五月婷婷久久综合| 欧美美女一区二区三区| 亚洲线精品一区二区三区八戒| 91一区二区三区在线观看| 中文字幕免费观看一区| 国产经典欧美精品| 欧美韩日一区二区三区| 国产高清精品久久久久| 国产亚洲婷婷免费| 成人自拍视频在线| 中文字幕中文字幕一区| 99久久精品国产导航| 中文字幕一区在线观看| 91在线播放网址| 亚洲精品亚洲人成人网在线播放| 色av成人天堂桃色av| 一区二区三区美女| 欧美日韩国产综合久久 | 久久久精品黄色| 国产成人在线视频免费播放| 国产精品视频一二三区| 97aⅴ精品视频一二三区| 亚洲日韩欧美一区二区在线| 日韩精品一区二区三区中文不卡| 久久99热这里只有精品| 精品久久久久一区二区国产| 国产精品一级在线| 国产精品初高中害羞小美女文| 99久久精品免费看国产免费软件| 亚洲色图欧洲色图| 欧美写真视频网站| 蜜桃久久久久久| 亚洲国产高清不卡| 91国产精品成人| 免费一级欧美片在线观看| 欧美精品一区二区久久久| 成人动漫一区二区| 午夜精品一区在线观看| 精品国产百合女同互慰| 91美女在线视频| 蜜桃久久久久久| 国产精品久久三| 91麻豆精品国产91久久久更新时间| 韩国v欧美v日本v亚洲v| 亚洲另类在线一区| 欧美大度的电影原声|