home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
- Object = "{075FBEB6-CFEC-11D2-98A0-006097BBCE7F}#87.0#0"; "bbbtn.ocx"
- Begin VB.Form frmDemo
- BorderStyle = 1 'Fixed Single
- Caption = "Graphic Viewer OCX Usage Demo"
- ClientHeight = 5355
- ClientLeft = 150
- ClientTop = 720
- ClientWidth = 5580
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5355
- ScaleWidth = 5580
- StartUpPosition = 3 'Windows Default
- Begin BBGraphicViewer.BBViewer BBViewer1
- Height = 4020
- Left = 0
- TabIndex = 13
- Top = 0
- Width = 5550
- _ExtentX = 9790
- _ExtentY = 7091
- End
- Begin MSComDlg.CommonDialog CommonDialog1
- Left = 2295
- Top = 1800
- _ExtentX = 847
- _ExtentY = 847
- _Version = 393216
- Filter = "*.*"
- End
- Begin VB.Frame Frame1
- Caption = "Zoom Factor"
- Height = 1230
- Left = 0
- TabIndex = 0
- Top = 4095
- Width = 5595
- Begin VB.OptionButton Option1
- Caption = "25%"
- Height = 285
- Index = 10
- Left = 90
- TabIndex = 10
- Top = 585
- Width = 960
- End
- Begin VB.OptionButton Option1
- Caption = "50%"
- Height = 285
- Index = 9
- Left = 1260
- TabIndex = 9
- Top = 270
- Width = 1005
- End
- Begin VB.OptionButton Option1
- Caption = "75%"
- Height = 285
- Index = 8
- Left = 1260
- TabIndex = 8
- Top = 585
- Width = 960
- End
- Begin VB.OptionButton Option1
- Caption = "Actual Size"
- Height = 285
- Index = 7
- Left = 2430
- TabIndex = 7
- Top = 270
- Width = 1140
- End
- Begin VB.OptionButton Option1
- Caption = "125%"
- Height = 285
- Index = 6
- Left = 2430
- TabIndex = 6
- Top = 585
- Width = 960
- End
- Begin VB.OptionButton Option1
- Caption = "150%"
- Height = 285
- Index = 5
- Left = 3690
- TabIndex = 5
- Top = 270
- Width = 960
- End
- Begin VB.OptionButton Option1
- Caption = "200%"
- Height = 285
- Index = 4
- Left = 3690
- TabIndex = 4
- Top = 585
- Width = 960
- End
- Begin VB.OptionButton Option1
- Caption = "300%"
- Height = 285
- Index = 3
- Left = 4770
- TabIndex = 3
- Top = 270
- Width = 780
- End
- Begin VB.OptionButton Option1
- Caption = "400%"
- Height = 285
- Index = 2
- Left = 4770
- TabIndex = 2
- Top = 585
- Width = 780
- End
- Begin VB.OptionButton Option1
- Caption = "10%"
- Height = 285
- Index = 0
- Left = 90
- TabIndex = 1
- Top = 270
- Width = 960
- End
- Begin VB.Label Label1
- BackStyle = 0 'Transparent
- Caption = "Copyrighted 1999 BiggieboySoftware"
- Height = 285
- Left = 1575
- TabIndex = 12
- Top = 990
- Width = 3570
- End
- End
- Begin VB.OptionButton Option1
- Caption = "10%"
- Height = 285
- Index = 1
- Left = 2295
- TabIndex = 11
- Top = 2385
- Visible = 0 'False
- Width = 960
- End
- Begin VB.Menu filemenu
- Caption = "File"
- Begin VB.Menu Open
- Caption = "Open"
- End
- Begin VB.Menu Exit
- Caption = "Exit"
- End
- End
- Begin VB.Menu about
- Caption = "About"
- Begin VB.Menu aboutin
- Caption = "About"
- End
- End
- Attribute VB_Name = "frmDemo"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '**** A very simple graphic viewer utility to demonstrate the use of
- '**** BiggieBoy Software Graphic Viewer OCX component.
- Public PictureOpened As Variant
- Private Sub aboutin_Click()
- frmAbout.Show vbModal, Me
- End Sub
- Private Sub Exit_Click()
- End
- End Sub
- Private Sub Form_Load()
- BBViewer1.BackColor = RGB(255, 255, 255)
- Call ClearAllOptions
- End Sub
- Private Sub ClearAllOptions()
- Dim i As Integer
- For i = 0 To 10
- Option1(i).Value = False
- '*** Set all initial values to false
- Next
- End Sub
- Private Sub Open_Click()
- Dim errstat As Variant
- CommonDialog1.Filter = "Bitmap (*.BMP)|*.BMP|JPG (*.JPG)|*.JPG|GIF (*.GIF)|*.GIF|Icon (*.ICO)|*.ICO|Window Meta Files (*.WMF)|*.WMF|Cursors (*.CUR)|*.CUR"
- CommonDialog1.FileName = "*.bmp;*.jpg;*.gif;*.ico;*.wmf;*.cur"
- CommonDialog1.DialogTitle = "Select A Picture File"
- CommonDialog1.ShowOpen
- PictureOpened = CommonDialog1.FileName
- On Error GoTo errorhandle
- Me.MousePointer = vbHourglass
- Set BBViewer1.Picture = LoadPicture(PictureOpened)
- Me.MousePointer = vbDefault
- Call ClearAllOptions
- Option1(7).Value = True
- '*** Immediately after file is opened, set actual size=true
- Exit Sub
- errorhandle:
- If Not CommonDialog1.CancelError Then
- errstat = MsgBox("Format Not supported. Unable to open picture file.", vbCritical)
- End If
- End Sub
- Private Sub Option1_Click(Index As Integer)
- Dim ZoomFactor
- Option1(Index).Value = True
- ZoomFactor = 1
- Select Case Index
- Case 0
- ZoomFactor = 0.1
- Case 10
- ZoomFactor = 0.25
- Case 9
- ZoomFactor = 0.5
- Case 8
- ZoomFactor = 0.75
- Case 7
- ZoomFactor = 1
- Case 6
- ZoomFactor = 1.25
- Case 5
- ZoomFactor = 1.5
- Case 4
- ZoomFactor = 2
- Case 3
- ZoomFactor = 3
- Case 2
- ZoomFactor = 4
-
- End Select
- BBViewer1.Zoom = ZoomFactor
- End Sub
-