home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / leadtools / ocx32.lt / VIEW.BAS < prev    next >
Encoding:
BASIC Source File  |  1996-04-10  |  1.1 KB  |  50 lines

  1. Attribute VB_Name = "View"
  2. Global Const VIEW_NORMAL = 100
  3. Global Const VIEW_STRETCH = 0
  4. Global Const VIEW_FIT = -1
  5.  
  6. Global ZoomFactorX As Double
  7. Global ZoomFactorY As Double
  8.  
  9. Sub ViewerInitTheForm(Frm As ViewFrm, Title$, FileName$, Page%, fPaintWL As Integer)
  10.   Dim nPage As Integer
  11.   
  12.   Frm.Caption = Title
  13.   Frm.Lead1.PaintDither = gDitheringType
  14.   Frm.Lead1.PaintPalette = gPaintFixed
  15.   Frm.Lead1.BitonalScaling = gBitonalType
  16.   Frm.Lead1.AutoScroll = True
  17.   Frm.Lead1.AutoRepaint = True
  18.  
  19.   If FileName <> "" Then
  20.     If Page < 2 Then
  21.       nPage = 1
  22.     Else
  23.       nPage = Page
  24.     End If
  25.     
  26.     Frm.Lead1.PaintWhileLoad = fPaintWL
  27.  
  28.     On Error GoTo ErrorLoad
  29.     Frm.Lead1.GetFileInfo FileName, nPage
  30.     
  31.     'Use twips to position the control
  32.     Frm.Lead1.ScaleMode = 1
  33.  
  34.     Frm.Width = Frm.Lead1.InfoWidth + DiffWidth
  35.     Frm.Height = Frm.Lead1.InfoHeight + DiffHeight
  36.     Frm.Lead1.left = 0
  37.     Frm.Lead1.top = 0
  38.     Frm.Lead1.Width = Frm.Lead1.InfoWidth
  39.     Frm.Lead1.Height = Frm.Lead1.InfoHeight
  40.   End If
  41. Exit Sub
  42.  
  43. ErrorLoad:
  44. End Sub
  45.  
  46.  
  47.  
  48.  
  49.  
  50.