home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 5 / MasteringVisualBasic5.iso / olympus / ik32_15t / vb4.shr / print.Frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-07-24  |  4.9 KB  |  162 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Print"
  5.    ClientHeight    =   5655
  6.    ClientLeft      =   1965
  7.    ClientTop       =   2970
  8.    ClientWidth     =   10110
  9.    Height          =   6345
  10.    Left            =   1905
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   5655
  15.    ScaleWidth      =   10110
  16.    Top             =   2340
  17.    Width           =   10230
  18.    Begin VB.TextBox Text1 
  19.       Height          =   285
  20.       Left            =   8880
  21.       TabIndex        =   9
  22.       Top             =   120
  23.       Width           =   975
  24.    End
  25.    Begin VB.TextBox Text4 
  26.       Height          =   285
  27.       Left            =   8880
  28.       TabIndex        =   7
  29.       Top             =   1200
  30.       Width           =   975
  31.    End
  32.    Begin VB.TextBox Text3 
  33.       Height          =   285
  34.       Left            =   8880
  35.       TabIndex        =   6
  36.       Top             =   840
  37.       Width           =   975
  38.    End
  39.    Begin VB.TextBox Text2 
  40.       Height          =   285
  41.       Left            =   8880
  42.       TabIndex        =   5
  43.       Top             =   480
  44.       Width           =   975
  45.    End
  46.    Begin VB.CommandButton Command1 
  47.       Caption         =   "&Print"
  48.       Height          =   495
  49.       Left            =   8160
  50.       TabIndex        =   0
  51.       Top             =   2520
  52.       Width           =   1215
  53.    End
  54.    Begin ik32Lib.Picbuf Picbuf1 
  55.       Height          =   4095
  56.       Left            =   120
  57.       TabIndex        =   11
  58.       Top             =   0
  59.       Width           =   5175
  60.       _Version        =   65536
  61.       _ExtentX        =   9128
  62.       _ExtentY        =   7223
  63.       _StockProps     =   253
  64.    End
  65.    Begin VB.Label Label6 
  66.       Alignment       =   2  'Center
  67.       Caption         =   "The text along the bottom of the PicBuf will print along with the image."
  68.       Height          =   615
  69.       Left            =   7560
  70.       TabIndex        =   10
  71.       Top             =   1680
  72.       Width           =   2535
  73.    End
  74.    Begin VB.Label lblMKOCX 
  75.       Alignment       =   2  'Center
  76.       Caption         =   "Buy MediaKnife OCX for all your multimedia needs!"
  77.       Height          =   255
  78.       Left            =   1800
  79.       TabIndex        =   8
  80.       Top             =   5400
  81.       Width           =   3975
  82.    End
  83.    Begin VB.Label Label4 
  84.       Caption         =   "PrintTop"
  85.       Height          =   255
  86.       Left            =   7800
  87.       TabIndex        =   4
  88.       Top             =   1200
  89.       Width           =   975
  90.    End
  91.    Begin VB.Label Label3 
  92.       Caption         =   "PrintLeft"
  93.       Height          =   255
  94.       Left            =   7800
  95.       TabIndex        =   3
  96.       Top             =   840
  97.       Width           =   975
  98.    End
  99.    Begin VB.Label Label2 
  100.       Caption         =   "PrintWidth"
  101.       Height          =   255
  102.       Left            =   7800
  103.       TabIndex        =   2
  104.       Top             =   480
  105.       Width           =   975
  106.    End
  107.    Begin VB.Label Label1 
  108.       Caption         =   "PrintHeight"
  109.       Height          =   255
  110.       Left            =   7800
  111.       TabIndex        =   1
  112.       Top             =   120
  113.       Width           =   975
  114.    End
  115.    Begin VB.Menu mnuFile 
  116.       Caption         =   "&File"
  117.       Begin VB.Menu mnuExit 
  118.          Caption         =   "E&xit"
  119.          Shortcut        =   ^X
  120.       End
  121.    End
  122. Attribute VB_Name = "Form1"
  123. Attribute VB_Creatable = False
  124. Attribute VB_Exposed = False
  125. 'Description: This code prints the picbuf and its surrounding
  126. 'labels to the printer using pixels as units.
  127. Private Sub Command1_Click()
  128.     Printer.ScaleMode = 3
  129.     Printer.Print
  130.     Picbuf1.PrintHeight = Val(Text1)
  131.     Picbuf1.PrintWidth = Val(Text2)
  132.     Picbuf1.PrintLeft = Val(Text3)
  133.     Picbuf1.PrintTop = Val(Text4)
  134.     Picbuf1.PrinterhDC = Printer.hDC
  135.     Printer.CurrentX = Picbuf1.PrintLeft
  136.     Printer.CurrentY = Picbuf1.PrintTop + Picbuf1.PrintHeight
  137.     Printer.Print lblMKOCX
  138.     'tell the printer we are done printing
  139.     Printer.EndDoc
  140. End Sub
  141. 'Description: This code sets up the picbuf to be
  142. 'printed
  143. Private Sub Form_Load()
  144.     'This sets up the picbuf with an image, and
  145.     'sets autosize to true
  146.     Picbuf1.AutoSize = True
  147.     InitPicbuf Picbuf1, False, "Marybeth.tif"
  148.     'This centers the label according to the
  149.     'image
  150.     lblMKOCX.Top = Picbuf1.Top + Picbuf1.Height
  151.     lblMKOCX.Left = Picbuf1.Width / 2 - lblMKOCX.Width / 2
  152.     'this will make the printed image the same size
  153.     'as it is on screen.
  154.     Text1 = Int(Picbuf1.Yresolution * Screen.TwipsPerPixelY / Printer.TwipsPerPixelY)
  155.     Text2 = Int(Picbuf1.Xresolution * Screen.TwipsPerPixelX / Printer.TwipsPerPixelX)
  156.     Text3 = 0
  157.     Text4 = 0
  158. End Sub
  159. Private Sub mnuExit_Click()
  160.     ExitProgram
  161. End Sub
  162.