home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- BorderStyle = 1 'Fixed Single
- Caption = "Store"
- ClientHeight = 3615
- ClientLeft = 1425
- ClientTop = 2265
- ClientWidth = 5475
- Height = 4305
- Left = 1365
- LinkTopic = "Form1"
- LockControls = -1 'True
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3615
- ScaleWidth = 5475
- Top = 1635
- Width = 5595
- Begin VB.Frame Frame1
- Caption = "Image Information"
- Height = 1095
- Left = 90
- TabIndex = 11
- Top = 2430
- Width = 3075
- Begin VB.Label lblHeight
- Caption = "lblHeight"
- Height = 195
- Left = 1440
- TabIndex = 17
- Top = 810
- Width = 1005
- End
- Begin VB.Label lblWidth
- Caption = "lblWidth"
- Height = 195
- Left = 1440
- TabIndex = 16
- Top = 540
- Width = 915
- End
- Begin VB.Label Label6
- Caption = "Height:"
- Height = 195
- Left = 90
- TabIndex = 15
- Top = 810
- Width = 915
- End
- Begin VB.Label Label5
- Caption = "Width:"
- Height = 195
- Left = 90
- TabIndex = 14
- Top = 540
- Width = 825
- End
- Begin VB.Label lblBitDepth
- Caption = "lblBitDepth"
- Height = 195
- Left = 1440
- TabIndex = 13
- Top = 270
- Width = 825
- End
- Begin VB.Label Label4
- Caption = "Bit Depth:"
- Height = 195
- Left = 90
- TabIndex = 12
- Top = 270
- Width = 1005
- End
- End
- Begin VB.Frame frmJPEGOptions
- Caption = "JPEG and PNG Options"
- Enabled = 0 'False
- Height = 2925
- Left = 3240
- TabIndex = 6
- Top = 600
- Width = 2115
- Begin VB.OptionButton optWriteOptions
- Caption = "Grayscale 8-bit"
- Height = 255
- Index = 2
- Left = 360
- TabIndex = 3
- Top = 1200
- Width = 1455
- End
- Begin VB.OptionButton optWriteOptions
- Caption = "Progressive"
- Height = 255
- Index = 1
- Left = 360
- TabIndex = 2
- Top = 840
- Width = 1215
- End
- Begin VB.OptionButton optWriteOptions
- Caption = "Progressive Grayscale 8-bit"
- Height = 495
- Index = 3
- Left = 360
- TabIndex = 4
- Top = 1440
- Width = 1455
- End
- Begin VB.OptionButton optWriteOptions
- Caption = "None"
- Height = 255
- Index = 0
- Left = 360
- TabIndex = 1
- Top = 480
- Width = 1215
- End
- Begin VB.TextBox txtWriteCompression
- Height = 285
- Left = 1200
- TabIndex = 5
- Text = "txtWriteCompression"
- Top = 2430
- Width = 495
- End
- Begin VB.Label Label3
- Caption = "Write Compression (5...100):"
- Height = 615
- Left = 120
- TabIndex = 9
- Top = 2160
- Width = 975
- End
- Begin VB.Label Label2
- Caption = "WriteOption:"
- Height = 255
- Left = 120
- TabIndex = 8
- Top = 240
- Width = 1095
- End
- End
- Begin VB.ComboBox cmbFileType
- Height = 315
- Left = 3240
- TabIndex = 0
- Text = "cmbFileType"
- Top = 240
- Width = 2115
- End
- Begin ik32Lib.Picbuf Picbuf1
- Height = 2385
- Left = 120
- TabIndex = 10
- TabStop = 0 'False
- Top = 0
- Width = 3015
- _Version = 65536
- _ExtentX = 5318
- _ExtentY = 4207
- _StockProps = 253
- End
- Begin MSComDlg.CommonDialog CommonDialog1
- Left = 4980
- Top = 360
- _Version = 65536
- _ExtentX = 847
- _ExtentY = 847
- _StockProps = 0
- End
- Begin VB.Label Label1
- Caption = "Save File As:"
- Height = 255
- Left = 3240
- TabIndex = 7
- Top = 0
- Width = 1815
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuLoad
- Caption = "&Load Image..."
- End
- Begin VB.Menu mnuSave
- Caption = "&Save Image..."
- End
- Begin VB.Menu mnuExit
- Caption = "E&xit"
- Shortcut = ^X
- End
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- 'Description: This sub resets all the values of
- 'text boxes, labels, and option buttons.
- Sub InitControlValues()
- 'Init control values
- lblWidth.Caption = Picbuf1.Xresolution
- lblHeight.Caption = Picbuf1.Yresolution
- lblBitDepth.Caption = Picbuf1.ColorDepth
- txtWriteCompression.Text = 0
- optWriteOptions(0).Value = True
- End Sub
- 'Description: This code determines if the JPEG or PNG file
- 'type has been selected or not
- Private Sub cmbFileType_Click()
- Select Case UCase(Mid(cmbFileType.Text, Len(cmbFileType.Text) - 2, 3))
- Case "PEG", "PNG", "UTO"
- frmJPEGOptions.Enabled = True
- txtWriteCompression.Text = 100
- Case Else
- optWriteOptions(0).Value = True
- txtWriteCompression = 0
- frmJPEGOptions.Enabled = False
- End Select
- End Sub
- 'Description: This code initializes all preset
- 'values
- Private Sub Form_Load()
- 'Add data to image type combo box
- InitcmbImageFormat cmbFileType
- InitPicbuf Picbuf1, True, "balloon.bmp"
- InitControlValues
- End Sub
- 'Description: This code exits the program
- Private Sub mnuExit_Click()
- ExitProgram
- End Sub
- 'Description: This code uses the Common Dialog
- 'control to select a file name, and then loads that
- 'image into the picbuf
- Private Sub mnuLoad_Click()
- LoadImage Picbuf1, CommonDialog1
- InitControlValues
- End Sub
- 'Description: This code determines which file type
- 'has been selected, and then, using the Common
- 'Dialog control, saves the image under a specified
- 'file name
- Private Sub mnuSave_Click()
- 'set image format type
- Picbuf1.ImageFormat = Val(Left(cmbFileType, 1))
- If Picbuf1.WriteOption > 1 Then
- Picbuf1.GrayScale
- End If
- SaveImage Picbuf1, CommonDialog1
- lblBitDepth.Caption = Picbuf1.ColorDepth
- End Sub
- 'Description: This code sets the Write Option for
- 'the picbuf control depending on which option
- 'button has been chosen
- Private Sub optWriteOptions_Click(Index As Integer)
- Picbuf1.WriteOption = Index
- End Sub
- 'Description: This code changes the WriteCompression
- 'property
- Private Sub txtWriteCompression_Change()
- Picbuf1.WriteCompression = Val(txtWriteCompression.Text)
- End Sub
-