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

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

?? printer.htm

?? 對于學習很有幫助
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
  Device := ADevice;
  Port := APort;
end;

function TPrinterDevice.IsEqual(ADriver, ADevice, APort: PChar): Boolean;
begin
  Result := (Device = ADevice) and (Port = APort);
end;


procedure TRawprinter.startraw;
var
  CTitle: array[0..31] of Char;
  CMode : Array[0..4] of char;
  DocInfo: TDocInfo;
  r : integer;
begin
  StrPLCopy(CTitle, Title, SizeOf(CTitle) - 1);
  StrPCopy(CMode, 'RAW');
  FillChar(DocInfo, SizeOf(DocInfo), 0);
  with DocInfo do
  begin
    cbSize := SizeOf(DocInfo);
    lpszDocName := CTitle;
    lpszOutput := nil;
    lpszDatatype :=CMode;
  end;
  with TPrinterDevice(Printers.Objects[PrinterIndex]) do
  begin
    DC2 := CreateDC(PChar(Driver), PChar(Device), PChar(Port), nil);
  end;
  SetAbortProc(dc2, AbortProc);
  r:=StartDoc(dc2, DocInfo);
end;

procedure TRawprinter.endraw;
var r : integer;
begin
  r:=windows.enddoc(dc2);
end;

type passrec = packed record
                 l : word;
                 s : Array[0..255] of char;
               end;
var pass : Passrec;
procedure TRawprinter.write(const s : string);
begin
  pass.l:=length(s);
  strpcopy(pass.s,s);
  escape(dc2,PASSTHROUGH,0,@pass,nil);
end;

procedure TRawprinter.writeln;
begin
  pass.l:=2;
  strpcopy(pass.s,#13#10);
  escape(dc2,PASSTHROUGH,0,@pass,nil);
end;

end.
</PRE><HR>

<P><H1><A NAME="printer8">Printing Tricks</P></A></H1>
<P><I>rgilland@ecn.net.au (Robert Gilland)</I></P>
<P><I>"Guy Vandenberg" &lt;guyvdb@MindSpring&gt;</I></P>

You are a genius. After pulling my hair out and downloading anything
that had anything to do with printing in delphi on the net and getting
nowhere fast. Your little piece of code actually made sence to me and
was userfrindly. I put it together with other code other small hints
on printing and I got the below. Use it to your delight. You were the
initiator. <p>

<HR><PRE>const INCHES_PER_MILIMETER : Real  = 0.04;

type
  TOffset =   record
               X,Y: Integer;
              end;

var FDeviceName : String;  {Get the name}
    FPageHeightPixel, FPageWidthPixel : Integer ;  {Page height and Page Width}
    FOrientation : TPrinterOrientation; {Orientation}
    FPrintOffsetPixels : TOffset;
    FPixelsPerMMX,FPixelsPerMMY: Real;
    MMSize, FPageHeightMM : Integer;
    TheReport, TheHead, HeadLine, RecordLine, TFname, TLname :String;

procedure TMissing_Rep.GetDeviceSettings;

var
  retval: integer;
  PixX, PixY: Integer;

begin
    FDeviceName := Printer.Printers[Printer.PrinterIndex];  {Get the name}
    FPageHeightPixel := Printer.PageHeight;                 {Page height}
    FPageWidthPixel := Printer.PageWidth;                   {Page Width}
    FOrientation := Printer.Orientation;
{Orientation}
    {Get the printable area offsets}
    {$IFDEF WIN32}
       FPrintOffsetPixels.X := GetDeviceCaps(Printer.Handle, PHYSICALOFFSETX);
       FPrintOffsetPixels.Y := GetDeviceCaps(Printer.Handle, PHYSICALOFFSETY);
    {$ELSE}
       retval := Escape(Printer.Handle,GETPRINTINGOFFSET,
                        0, nil, @FPrintOffsetPixels);
    {$ENDIF}
    {Get Pixels per Milimeter Ratio}
    PixX := GetDeviceCaps(Printer.Handle, LOGPIXELSX);
    PixY :=  GetDeviceCaps(Printer.Handle, LOGPIXELSY);
    FPixelsPerMMX := INCHES_PER_MILIMETER * PixX;
    FPixelsPerMMY := INCHES_PER_MILIMETER  * PixY;
    FPageHeightMM := Round(FPageHeightPixel/FPixelsPerMMY);
 end;

function TMissing_Rep.PutText(mmX,mmY: Integer; S: string; LeftAlign:
Boolean): boolean;
var
  X, Y: Integer;
  align: WORD;
begin
  if LeftAlign then
    align :=  SetTextAlign(Printer.Handle,TA_BOTTOM or TA_LEFT)
  else
    align :=  SetTextAlign(Printer.Handle,TA_BOTTOM or TA_RIGHT);
  result := FALSE; {Assume fail}
  X := Trunc(mmX * FPixelsPerMMX) - FPrintOffsetPixels.X;
  Y := Trunc(mmY * FPixelsPerMMY) - FPrintOffsetPixels.Y;
  if X < 0 then exit;
  if Y < 0 then exit;
  Printer.Canvas.TextOut(X,Y,S);
  result := TRUE;
end;

procedure TMissing_Rep.Print_ButClick(Sender: TObject);

var PixelSize: Integer;

begin
Print_But.Enabled := False;
if PrintDialog1.Execute then
 begin
 Printer.Canvas.Font := Missing_Rep.Font;
 PixelSize := Printer.Canvas.TextHeight('Yy');
 MMSize := Round(PixelSize/FPixelsPerMMY);
 Printer.Title := 'Breast Cancer Project Missing Report';
 Printer.BeginDoc;                        { begin to send print job to printer }
 PrintGenerator;
 Printer.EndDoc;                 { EndDoc ends and starts printing print job }
 end;
 Print_But.Enabled := True;
 end;

procedure TMissing_Rep.PrintGenerator;

Var
  yLoc , NumRows, TheRow :Integer;

  procedure Heading;
  begin
   yLoc := 20;
   PutText(20, 20, TheHead, TRUE);
   yLoc := yLoc + MMSize;
   PutText(20,  yLoc, StringGrid1.Cells[0,0], TRUE);
   PutText(60,  yLoc, StringGrid1.Cells[1,0], TRUE);
   PutText(100, yLoc, StringGrid1.Cells[2,0], TRUE);
   PutText(120, yLoc, StringGrid1.Cells[3,0], TRUE);
   PutText(150, yLoc, StringGrid1.Cells[4,0], TRUE);
   yLoc := yLoc + MMSize;
 end;

  procedure Footer;
  begin
  PutText(100,FPageHeightMM,InttoStr(Printer.PageNumber), TRUE);
  end;

begin
   Heading;
   TheRow := 1;
   while (TheRow < StringGrid1.RowCount) do
   begin
       if (yLoc > (FPageHeightMM - MMSize)) then
	   begin
		  Footer;
		  Printer.NewPage;
		  Heading;
  	   end;
	 TheGauge.Progress := Round(100 * TheRow/(StringGrid1.RowCount - 1));
	 PutText(20,  yLoc, StringGrid1.Cells[0,TheRow], TRUE);
	 PutText(60,  yLoc, StringGrid1.Cells[1,TheRow], TRUE);
	 PutText(100, yLoc, StringGrid1.Cells[2,TheRow], TRUE);
	 PutText(120, yLoc, StringGrid1.Cells[3,TheRow], TRUE);
	 PutText(150, yLoc, StringGrid1.Cells[4,TheRow], TRUE);
	 yLoc := yLoc + MMSize;
	 TheRow := TheRow + 1;
 end;
Footer;
end;
</PRE><HR>

<P><H1><A NAME="printer9">Passthough escape function</P></A></H1>
<P><I>"Joe C. Hecht" &lt;jhecht@corp.borland.com&gt;</I></P>

Gilberto Beda wrote:
<PRE>> 
someone knows why some windows drivers don't work with a passthrough in
Escape function? 
 
Is it possible to know if a driver printer support the PASSTROUGH
function? I believe Dos apps in 95 use the same function if I command
"copy file &gt; lpt1" Windows95 use the predefint drivers to spool the
report to printer.
</PRE>

Although Delphi's TPrinter unit makes it easy to interface
to a given printer, there are times when you may need
to drop down to the printers level and send device specific
escape sequences. Under sixteen bit versions of Windows, this
was as easy as opening the printer port, but under Windows NT,
directly accessing the hardware is is illegal. One solution
is to use the Windows "PASSTHROUGH" escape to send an escape
sequence directly to the printer. In order to use the
"PASSTHROUGH" escape, it must be supported by the printer
driver. Be forwarned that not all printer drivers will support
this feature.<p>

It's worth noting that the "PASSTHROUGH" escape is documented
as obsolete for thirty-two bit applications. It should be a
number of years before this escape goes by the way, since
it is used in many commercial applications.<p>

The example code presented is not targeted to any specific
printer model. You will need to know the correct escape
sequences to send to the printer you are interfacing to.
Note that you must still call the BeginDoc and EndDoc methods
of TPrinter. During the BeginDoc call, the printer driver
initializes the printer as necessary, and during the EndDoc
call, the printer driver will uninitialize the printer and
eject the page. When you do make your escape call, the printer
may be set for the current windows mapping mode if the printer
supports scaling internaly. Technically, you should not do
anything that would cause the printer memory to be reset,
or eject a page with an escape sequence. In other words,
try to leave the printer in the same state it was in when
you made your escape. This is more important on intellegent
printers (Postscript printers), and not important at all on
a standard TTY line printer, where you can do just about
anything you like, including ejecting pages.<p>

<I>Code Example:</I><p>

You will need to declare a structure to hold the buffer you are
sending. The structure of the buffer is defined as a word containing
the length of the buffer, followed by the buffer containing the data.<p>

Before making the escape call to pass the data, we will use
the escape "QUERYESCSUPPORT" to determine if the "PASSTHROUGH"
escape is supported by the print driver.<p>

Finally, be aware that your data will be inserted directly into
the printers data stream. On some printer models (Postscript),
you may need to add a space to the start and end of your data
to separate your data from the printer drivers data.<p>

(Postscript is a Registered Trademark of Adobe Systems Incorporated) <p>

*)

<HR><PRE>
unit Esc1;

interface

uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{ add the printers unit }
uses
   Printers;

{$R *.DFM}

{ declare the "PASSTHROUGH" structure }
type TPrnBuffRec = record
  BuffLength : word;
  Buffer : array [0..255] of char;
end;


procedure TForm1.Button1Click(Sender: TObject);
var
  Buff : TPrnBuffRec;
  TestInt : integer;
  s : string;
begin

{ Test to see if the "PASSTHROUGH" escape is supported }
  TestInt := PASSTHROUGH;
  if Escape(Printer.Handle,
            QUERYESCSUPPORT,
            sizeof(TestInt),
            @TestInt,
            nil) &gt; 0 then begin

  { Start the printout }
    Printer.BeginDoc;

  { Make a string to passthrough }
    s := ' A Test String ';

  { Copy the string to the buffer }
    StrPCopy(Buff.Buffer, s);

  { Set the buffer length }
    Buff.BuffLength := StrLen(Buff.Buffer);

  { Make the escape}
    Escape(Printer.Canvas.Handle,
           PASSTHROUGH,
           0,
           @Buff,
           nil);

  { End the printout }
    Printer.EndDoc;
  end;
end;

end.
</PRE><HR>


<P><H1><A NAME="printer10">Stretched bitmap on TPrinter</P></A></H1>
<P><I>wea@felten.co.at (Alexander Wernhart)</I></P>

<PRE>On Tue, 4 Feb 1997 20:54:43 -0300, Ruy Ponce de Leon Junior
&lt;rplj@di.ufpe.br&gt; wrote:


I'm writing a program that prints a bitmap to the printer
via TPrinter object. The problem occurs when I "stretch"
the bitmap to fit the adequate area on paper. Due to the
stretching (bitblts to Printer's DC), dotted patterns appear
on the <white> bitmap regions, making them almost gray.
This is an obvius undesired effect. Does anybody knows some 
approach to help me?
 
</PRE>

Try this:<p>

<HR><PRE>
procedure DrawImage(Canvas: TCanvas; DestRect: TRect; ABitmap:
TBitmap);
var
  Header, Bits: Pointer;
  HeaderSize: Integer;
  BitsSize: Longint;
begin
  GetDIBSizes(ABitmap.Handle, HeaderSize, BitsSize);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩中文字幕亚洲一区二区va在线 | 91精品国产麻豆| 亚洲国产人成综合网站| 在线观看国产一区二区| 午夜欧美大尺度福利影院在线看| 欧美日韩免费电影| 美脚の诱脚舐め脚责91| 久久久国产一区二区三区四区小说| 亚洲一区精品在线| 日韩手机在线导航| 成人激情免费网站| 亚洲成人自拍网| 久久伊人中文字幕| 成人h版在线观看| 午夜精品免费在线观看| 色狠狠色狠狠综合| 日韩一级完整毛片| 日本不卡视频在线| 日本va欧美va欧美va精品| 美女一区二区在线观看| 日韩精品一区二区在线| www.欧美色图| 日韩理论电影院| 欧美日韩国产a| 国产精品白丝jk黑袜喷水| 中文在线免费一区三区高中清不卡| 91国偷自产一区二区三区观看 | 久久亚洲免费视频| 色综合久久中文字幕综合网| 石原莉奈一区二区三区在线观看| 精品精品国产高清a毛片牛牛| 成人av电影在线| 蜜桃av一区二区三区| 亚洲欧洲性图库| 日韩视频一区二区三区在线播放| 国产福利一区二区| 亚洲1区2区3区视频| 国产清纯白嫩初高生在线观看91 | 日本在线不卡视频| 1区2区3区精品视频| 日韩亚洲欧美高清| 日本国产一区二区| 国产大片一区二区| 日本亚洲三级在线| 亚洲国产aⅴ天堂久久| 中文字幕一区av| 2020日本不卡一区二区视频| 欧美日韩国产影片| 色一情一乱一乱一91av| 国产丶欧美丶日本不卡视频| 美女视频网站黄色亚洲| 亚洲成a人片在线观看中文| 中文字幕字幕中文在线中不卡视频| 精品福利在线导航| 91精品麻豆日日躁夜夜躁| 91福利区一区二区三区| 91香蕉视频污| 91片在线免费观看| www.综合网.com| 欧美日韩在线不卡| 99视频精品全部免费在线| 国产乱对白刺激视频不卡| 日本成人在线一区| 无码av免费一区二区三区试看 | 看电视剧不卡顿的网站| 亚洲国产乱码最新视频 | 不卡电影免费在线播放一区| 精品一区二区综合| 麻豆精品视频在线| 蜜臀精品一区二区三区在线观看 | 精品久久国产97色综合| 正在播放亚洲一区| 4438亚洲最大| 欧美日韩成人综合天天影院 | 5858s免费视频成人| 欧美性欧美巨大黑白大战| 91久久免费观看| jizz一区二区| 91在线视频免费观看| 成人激情电影免费在线观看| 国产**成人网毛片九色| 狠狠v欧美v日韩v亚洲ⅴ| 国产一区二区三区免费| 中文字幕av一区二区三区高 | 欧美国产精品v| 国产午夜精品一区二区三区视频 | 日本中文字幕一区二区视频| 日韩1区2区3区| 精品一二三四区| 国产中文字幕一区| 国产成人av电影在线观看| 国产成人精品三级麻豆| 91色九色蝌蚪| 欧美色成人综合| 日韩一区二区电影在线| 久久久亚洲欧洲日产国码αv| 久久久91精品国产一区二区三区| 国产午夜精品理论片a级大结局 | 久久久精品2019中文字幕之3| 国产欧美精品一区aⅴ影院 | 蜜桃视频在线观看一区二区| 精品一区二区免费| 成人午夜精品一区二区三区| 色悠久久久久综合欧美99| 欧美美女一区二区三区| 久久综合中文字幕| 亚洲特级片在线| 日本在线不卡一区| 成人av免费在线观看| 欧美视频第二页| 久久这里只有精品6| 亚洲免费av网站| 久久精品72免费观看| 91精品国产乱| 久久毛片高清国产| 一区二区日韩电影| 久久99精品久久只有精品| av网站一区二区三区| 欧美一卡二卡三卡| 国产精品麻豆99久久久久久| 午夜久久久久久| eeuss鲁片一区二区三区在线观看| 欧美吻胸吃奶大尺度电影| 久久久精品免费网站| 一区二区三区在线不卡| 国产精品女人毛片| 99久久久久久| 日本一区二区三区国色天香 | 欧美国产日本韩| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 亚洲图片有声小说| 曰韩精品一区二区| 国产呦萝稀缺另类资源| 欧美日韩三级一区二区| 欧美国产日韩一二三区| 久久66热re国产| 精品视频色一区| 亚洲欧洲日韩一区二区三区| 韩国理伦片一区二区三区在线播放 | 国产精品福利一区二区三区| 日韩1区2区3区| 欧美三级资源在线| 一区在线播放视频| 国产99久久久国产精品免费看| 91精品国产乱| 午夜成人免费电影| 在线看一区二区| 亚洲人成7777| 99视频精品在线| 国产精品女人毛片| 99久久99久久免费精品蜜臀| 欧美精品一区二区三区蜜臀| 日韩成人午夜电影| 欧美日韩国产一二三| 亚洲黄色性网站| 在线亚洲免费视频| 亚洲人成在线观看一区二区| 成人精品免费网站| 国产欧美日韩综合精品一区二区| 极品美女销魂一区二区三区免费| 91 com成人网| 视频一区中文字幕| 欧美一级搡bbbb搡bbbb| 青青草视频一区| 日韩三级精品电影久久久| 日韩和欧美的一区| 日韩无一区二区| 麻豆一区二区三| 日韩欧美在线综合网| 看电视剧不卡顿的网站| 久久综合五月天婷婷伊人| 狠狠色丁香久久婷婷综合丁香| 欧美精品一区二区三区久久久| 久久99精品国产麻豆不卡| 久久亚洲一区二区三区明星换脸| 久久99国产精品久久| 久久久精品人体av艺术| 不卡一二三区首页| 亚洲综合色视频| 正在播放亚洲一区| 极品少妇一区二区| 日本一区二区久久| 色综合久久综合中文综合网| 亚洲电影欧美电影有声小说| 7777精品伊人久久久大香线蕉| 青青草97国产精品免费观看 | 91丨porny丨首页| 一级中文字幕一区二区| 欧美剧情片在线观看| 激情丁香综合五月| 国产蜜臀97一区二区三区| 91亚洲资源网| 日韩和的一区二区| 国产亚洲欧洲一区高清在线观看| 波波电影院一区二区三区| 一区二区三区中文字幕| 日韩欧美高清一区| 99久久99久久综合| 蜜臀av性久久久久蜜臀av麻豆| 久久久精品免费网站|