home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Graphics Viewer - OCX"
- ClientHeight = 6510
- ClientLeft = 60
- ClientTop = 600
- ClientWidth = 9480
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H00000000&
- Height = 7200
- Left = 0
- LinkTopic = "Form1"
- ScaleHeight = 434
- ScaleMode = 3 'Pixel
- ScaleWidth = 632
- Top = -30
- Width = 9600
- Begin VB.PictureBox Pic_GrayBox
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- ForeColor = &H80000008&
- Height = 255
- Left = 9240
- ScaleHeight = 225
- ScaleWidth = 225
- TabIndex = 0
- Top = 6240
- Visible = 0 'False
- Width = 255
- End
- Begin VB.HScrollBar HScroll1
- Height = 255
- LargeChange = 100
- Left = 0
- SmallChange = 20
- TabIndex = 1
- Top = 6240
- Visible = 0 'False
- Width = 9255
- End
- Begin VB.VScrollBar VScroll1
- Height = 6255
- LargeChange = 100
- Left = 9240
- SmallChange = 20
- TabIndex = 2
- Top = 0
- Visible = 0 'False
- Width = 255
- End
- Begin GvboxLib.Gvbox Gvbox1
- Height = 1500
- Left = 0
- TabIndex = 3
- Top = 0
- Visible = 0 'False
- Width = 1500
- _Version = 65536
- _ExtentX = 2646
- _ExtentY = 2646
- _StockProps = 105
- BackColor = 16777215
- BorderStyle = 1
- AutoSize = 1
- DCTMethod = 1
- Dither = 0
- FancyUpsampling = 0 'False
- FileName = ""
- JPEGDither = 1
- PrintX = 0
- PrintY = 0
- Thumbnail = 0
- Zoom = 1
- PrintZoom = 1
- TwoPassQuantize = 0 'False
- End
- Begin VB.Menu Mnu_File
- Caption = "&File"
- Begin VB.Menu Mnu_Print
- Caption = "&Print"
- HelpContextID = 2014
- End
- Begin VB.Menu Mnu_Exit
- Caption = "E&xit"
- End
- End
- Begin VB.Menu Mnu_Picture
- Caption = "&Picture"
- HelpContextID = 2010
- Begin VB.Menu Mnu_Open
- Caption = "&Open"
- HelpContextID = 2010
- End
- Begin VB.Menu Mnu_Close
- Caption = "&Close"
- HelpContextID = 2010
- End
- End
- Begin VB.Menu Mnu_Options
- Caption = "&Options"
- Begin VB.Menu Mnu_Auto
- Caption = "&Autosize"
- HelpContextID = 2005
- Begin VB.Menu Mnu_AutoSize
- Caption = "&Off"
- HelpContextID = 2005
- Index = 0
- End
- Begin VB.Menu Mnu_AutoSize
- Caption = "Fit to &Bitmap"
- Checked = -1 'True
- HelpContextID = 2005
- Index = 1
- End
- Begin VB.Menu Mnu_AutoSize
- Caption = "Fit &Horizontally"
- HelpContextID = 2005
- Index = 2
- End
- Begin VB.Menu Mnu_AutoSize
- Caption = "Fit &Vertically"
- HelpContextID = 2005
- Index = 3
- End
- End
- Begin VB.Menu Mnu_Dither
- Caption = "&Dithering..."
- HelpContextID = 2007
- Begin VB.Menu Mnu_Dith
- Caption = "&No Dithering"
- HelpContextID = 2007
- Index = 0
- End
- Begin VB.Menu Mnu_Dith
- Caption = "&Dither Always"
- HelpContextID = 2007
- Index = 1
- End
- Begin VB.Menu Mnu_Dith
- Caption = "Dither Extra &Colors"
- Checked = -1 'True
- HelpContextID = 2007
- Index = 2
- End
- End
- Begin VB.Menu Mnu_Thumbnail
- Caption = "&Thumbnail"
- HelpContextID = 2018
- End
- End
- Begin VB.Menu Mnu_JPEG
- Caption = "&JPEG Options"
- HelpContextID = 2025
- Begin VB.Menu Mnu_DCTM
- Caption = "&DCT Method..."
- HelpContextID = 2006
- Begin VB.Menu Mnu_DCT
- Caption = "&Slow Integer"
- HelpContextID = 2006
- Index = 0
- End
- Begin VB.Menu Mnu_DCT
- Caption = "&Fast Integer"
- Checked = -1 'True
- HelpContextID = 2006
- Index = 1
- End
- Begin VB.Menu Mnu_DCT
- Caption = "Floating &Point"
- HelpContextID = 2006
- Index = 2
- End
- End
- Begin VB.Menu Mnu_JPGDithM
- Caption = "Dithering &Method..."
- HelpContextID = 2007
- Begin VB.Menu Mnu_JPGDith
- Caption = "&None"
- HelpContextID = 2007
- Index = 0
- End
- Begin VB.Menu Mnu_JPGDith
- Caption = "&Ordered"
- Checked = -1 'True
- HelpContextID = 2007
- Index = 1
- End
- Begin VB.Menu Mnu_JPGDith
- Caption = "&Floyd-Steinberg"
- HelpContextID = 2007
- Index = 2
- End
- End
- Begin VB.Menu Mnu_Fancy
- Caption = "&Fancy Upsampline"
- HelpContextID = 2008
- End
- Begin VB.Menu Mnu_TwoPass
- Caption = "&Two Pass Quantize"
- HelpContextID = 2019
- End
- End
- Begin VB.Menu Mnu_Zoom
- Caption = "&Zoom"
- HelpContextID = 2020
- Begin VB.Menu Mnu_Pict
- Caption = "&Picture..."
- HelpContextID = 2020
- Begin VB.Menu Mnu_PZoom
- Caption = "&50%"
- Index = 0
- End
- Begin VB.Menu Mnu_PZoom
- Caption = "&100%"
- Checked = -1 'True
- HelpContextID = 2020
- Index = 1
- End
- Begin VB.Menu Mnu_PZoom
- Caption = "&200%"
- HelpContextID = 2020
- Index = 2
- End
- Begin VB.Menu Mnu_PZoom
- Caption = "&300%"
- HelpContextID = 2020
- Index = 3
- End
- Begin VB.Menu Mnu_PZoom
- Caption = "&400%"
- HelpContextID = 2020
- Index = 4
- End
- End
- Begin VB.Menu Mnu_Prnt
- Caption = "P&rint..."
- HelpContextID = 2017
- Begin VB.Menu Mnu_PrZoom
- Caption = "&100%"
- HelpContextID = 2017
- Index = 0
- End
- Begin VB.Menu Mnu_PrZoom
- Caption = "&200%"
- Checked = -1 'True
- HelpContextID = 2017
- Index = 1
- End
- Begin VB.Menu Mnu_PrZoom
- Caption = "&300%"
- HelpContextID = 2017
- Index = 2
- End
- Begin VB.Menu Mnu_PrZoom
- Caption = "&400%"
- HelpContextID = 2017
- Index = 3
- End
- Begin VB.Menu Mnu_PrZoom
- Caption = "&500%"
- HelpContextID = 2017
- Index = 4
- End
- End
- End
- Begin VB.Menu Mnu_HelpM
- Caption = "&Help"
- HelpContextID = 2000
- Begin VB.Menu Mnu_Help
- Caption = "&Contents"
- HelpContextID = 2000
- Index = 0
- End
- Begin VB.Menu Mnu_Help
- Caption = "&Events"
- HelpContextID = 2022
- Index = 1
- End
- Begin VB.Menu Mnu_Help
- Caption = "&Properties"
- HelpContextID = 2002
- Index = 2
- End
- Begin VB.Menu Mnu_Help
- Caption = "&Search"
- Index = 3
- End
- Begin VB.Menu Mnu_Help
- Caption = "&Using Help"
- Index = 4
- End
- Begin VB.Menu Mnu_Help
- Caption = "-"
- Index = 5
- End
- Begin VB.Menu Mnu_Help
- Caption = "&About"
- HelpContextID = 2004
- Index = 6
- End
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- DefInt A-Z
- Dim I%, PX!, PY!
- Const CONTENTS& = 2000
- Const EVENTS& = 2022
- Const MODAL = 1
- Const HELP_CONTEXT = &H1
- Const HELP_HELPONHELP = &H4
- Const PROPERTIES& = 2002
- Const SEARCH& = 1
- Private Sub Form_Load()
- ChDir App.Path
- Move 0, 0
- Width = Screen.Width
- Height = Screen.Height
- End Sub
- Private Sub Form_Resize()
- If GVBox1.Height > Form1.ScaleHeight Then
- VScroll1.Visible = True
- Else
- VScroll1.Visible = False
- End If
- If GVBox1.Width > Form1.ScaleWidth Then
- HScroll1.Visible = True
- Else
- HScroll1.Visible = False
- End If
- VScroll1.Max = GVBox1.Height - Form1.ScaleHeight + HScroll1.Height
- HScroll1.Max = GVBox1.Width - Form1.ScaleWidth + VScroll1.Width
- If VScroll1.Visible Or HScroll1.Visible Then
- Pic_GrayBox.Visible = True
- Else
- Pic_GrayBox.Visible = False
- End If
- If WindowState <> 1 Then
- HScroll1.Width = Form1.ScaleWidth - VScroll1.Width
- VScroll1.Height = Form1.ScaleHeight - HScroll1.Height
- HScroll1.Move 0, Form1.ScaleHeight - HScroll1.Height
- VScroll1.Move Form1.ScaleWidth - VScroll1.Width, 0
- Pic_GrayBox.Move Form1.ScaleWidth - VScroll1.Width, Form1.ScaleHeight - HScroll1.Height
- VScroll1.Max = GVBox1.Height - Form1.ScaleHeight + HScroll1.Height
- HScroll1.Max = GVBox1.Width - Form1.ScaleWidth + VScroll1.Width
- HScroll1.ZOrder
- VScroll1.ZOrder
- Pic_GrayBox.ZOrder
- End If
- End Sub
- Private Sub HScroll1_Change()
- PX = -HScroll1.Value
- GVBox1.Move PX, PY
- End Sub
- Private Sub Mnu_AutoSize_Click(Index As Integer)
- For I = 0 To 3
- Mnu_Autosize(I).Checked = False
- Next I
- GVBox1.AutoSize = Index
- Mnu_Autosize(Index).Checked = True
- End Sub
- Private Sub Mnu_Close_Click()
- GVBox1.filename = ""
- GVBox1.Visible = False
- HScroll1.Visible = False
- VScroll1.Visible = False
- Pic_GrayBox.Visible = False
- End Sub
- Private Sub Mnu_DCT_Click(Index As Integer)
- For I = 0 To 2
- Mnu_DCT(I).Checked = False
- Next I
- GVBox1.DCTMethod = Index
- Mnu_DCT(Index).Checked = True
- End Sub
- Private Sub Mnu_Dith_Click(Index As Integer)
- For I = 0 To 2
- Mnu_Dith(I).Checked = False
- Next I
- GVBox1.Dither = Index
- Mnu_Dith(Index).Checked = True
- End Sub
- Private Sub Mnu_Exit_Click()
- End
- End Sub
- Private Sub Mnu_Fancy_Click()
- If Mnu_Fancy.Checked Then
- Mnu_Fancy.Checked = False
- Else
- Mnu_Fancy.Checked = True
- End If
- GVBox1.FancyUpsampling = Mnu_Fancy.Checked
- End Sub
- Private Sub Mnu_Help_Click(Index As Integer)
- Dim Ret%
- Select Case Index
- Case 0
- Ret = WinHelp(Form1.hwnd, App.HelpFile, HELP_CONTEXT, CONTENTS)
- Case 1
- Ret = WinHelp(Form1.hwnd, App.HelpFile, HELP_CONTEXT, EVENTS)
- Case 2
- Ret = WinHelp(Form1.hwnd, App.HelpFile, HELP_CONTEXT, PROPERTIES)
- Case 3
- Ret = WinHelp(Form1.hwnd, App.HelpFile, HELP_CONTEXT, SEARCH)
- Case 4
- Ret = WinHelp(Form1.hwnd, "", HELP_HELPONHELP, 0)
- Case 6
- About_Frm.Show MODAL
- End Select
- End Sub
- Private Sub Mnu_JPGDith_Click(Index As Integer)
- For I = 0 To 2
- Mnu_JPGDith(I).Checked = False
- Next I
- GVBox1.JPEGDither = Index
- Mnu_JPGDith(Index).Checked = True
- End Sub
- Private Sub Mnu_Open_Click()
- On Error GoTo Er_Hndl
- GVBox1.Visible = False
- GVBox1.filename = ""
- GVBox1.GVOpenPicture = True
- If GVBox1.filename <> "" Then
- GVBox1.Visible = True
- VScroll1.Value = 0
- HScroll1.Value = 0
- GVBox1.Left = 0
- GVBox1.Top = 0
- VScroll1.Visible = False
- HScroll1.Visible = False
- Pic_GrayBox.Visible = False
- Form_Resize
- End If
- Exit Sub
- Er_Hndl:
- Beep
- MsgBox Error$, 48, "Graphics Viewer"
- Exit Sub
- End Sub
- Private Sub Mnu_Print_Click()
- Screen.MousePointer = 11
- Printer.Print " "
- Printer.ScaleMode = 3
- GVBox1.PrintX = (Printer.ScaleWidth - (GVBox1.bmpw * GVBox1.PrintZoom)) / 2
- GVBox1.PrintY = (Printer.ScaleHeight - (GVBox1.bmph * GVBox1.PrintZoom)) / 2
- GVBox1.PrintHDC = Printer.hDC
- Printer.EndDoc
- Screen.MousePointer = 0
- End Sub
- Private Sub Mnu_PrZoom_Click(Index As Integer)
- For I = 0 To 4
- Mnu_PrZoom(I).Checked = False
- Next I
- GVBox1.PrintZoom = Index + 1
- Mnu_PrZoom(Index).Checked = True
- End Sub
- Private Sub Mnu_PZoom_Click(Index As Integer)
- For I = 0 To 3
- Mnu_PZoom(I).Checked = False
- Next I
- If Index = 0 Then
- GVBox1.Zoom = 0.5
- Else
- GVBox1.Zoom = Index
- End If
- Mnu_PZoom(Index).Checked = True
- If GVBox1.Visible Then Form_Resize
- End Sub
- Private Sub Mnu_Thumbnail_Click()
- If Mnu_Thumbnail.Checked Then
- Mnu_Thumbnail.Checked = False
- GVBox1.Thumbnail = 0
- Else
- Mnu_Thumbnail.Checked = True
- GVBox1.Thumbnail = 100
- End If
- If GVBox1.Thumbnail Then
- VScroll1.Value = 0
- HScroll1.Value = 0
- GVBox1.Left = 0
- GVBox1.Top = 0
- VScroll1.Visible = False
- HScroll1.Visible = False
- Pic_GrayBox.Visible = False
- Else
- If GVBox1.Visible Then Form_Resize
- End If
- End Sub
- Private Sub Mnu_TwoPass_Click()
- If Mnu_TwoPass.Checked Then
- Mnu_TwoPass.Checked = False
- Else
- Mnu_TwoPass.Checked = True
- End If
- GVBox1.TwoPassQuantize = Mnu_TwoPass.Checked
- End Sub
- Private Sub Pic_GrayBox_Click()
- HScroll1.Value = HScroll1.Max
- VScroll1.Value = VScroll1.Max
- End Sub
- Private Sub Pic_GrayBox_DblClick()
- HScroll1.Value = 0
- VScroll1.Value = 0
- End Sub
- Private Sub VScroll1_Change()
- PY = -VScroll1.Value
- GVBox1.Move PX, PY
- End Sub
-