Guidance
指路人
g.yi.org
software / rapidq / Examples / Devices / Printer & Parallel Port / Print QBitmap.bas

Register 
新用户注册
Search 搜索
首页 
Home Home
Software
Upload

  
' From:  "lenzpaul" <paul@l...> Wed Sep 4, 2002  2:42 pm
'This program creates 20 times a QBITMAP,
'matches it's size to 1/5 of the paper size,
'writes a number and a line on the bitmap,
'and prints the bitmap.

     DIM pw AS INTEGER

     SUB MakeImage (n AS INTEGER)
      DIM Font AS QFONT
      Font.Size = pw / 50
      DIM Image AS QBITMAP
      Image.Width = pw \ 5
      Image.Height = Image.Width
      Image.Font = Font
      Image.TextOut 0, 0, STR$(n), 0, &HFFFFFF
      Image.Line 0, 0, Image.Height, Image.Width, 0
      DIM S AS QRECT
      S.Left = 0
      S.Top = 0
      S.Right = Image.Width
      S.Bottom = Image.Height
      DIM D AS QRECT
      D.Left = (n MOD 4) * (pw \ 4)
      D.Top = (n \ 4) * (pw \ 4)
      D.Right = D.Left + Image.Width
      D.Bottom = D.Top + Image.Height
      Printer.CopyRect D, Image, S
     END SUB

     Printer.BeginDoc
     pw = Printer.PageWidth
     FOR i = 0 TO 19
      MakeImage(i)
     NEXT
     Printer.EndDoc
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Thu 2021-10-21  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2002-09-04 18:50:06