home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 5 / MasteringVisualBasic5.iso / olympus / ik32_15t / vb4.shr / Store.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-08-07  |  8.2 KB  |  262 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Store"
  5.    ClientHeight    =   3615
  6.    ClientLeft      =   1425
  7.    ClientTop       =   2265
  8.    ClientWidth     =   5475
  9.    Height          =   4305
  10.    Left            =   1365
  11.    LinkTopic       =   "Form1"
  12.    LockControls    =   -1  'True
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   3615
  16.    ScaleWidth      =   5475
  17.    Top             =   1635
  18.    Width           =   5595
  19.    Begin VB.Frame Frame1 
  20.       Caption         =   "Image Information"
  21.       Height          =   1095
  22.       Left            =   90
  23.       TabIndex        =   11
  24.       Top             =   2430
  25.       Width           =   3075
  26.       Begin VB.Label lblHeight 
  27.          Caption         =   "lblHeight"
  28.          Height          =   195
  29.          Left            =   1440
  30.          TabIndex        =   17
  31.          Top             =   810
  32.          Width           =   1005
  33.       End
  34.       Begin VB.Label lblWidth 
  35.          Caption         =   "lblWidth"
  36.          Height          =   195
  37.          Left            =   1440
  38.          TabIndex        =   16
  39.          Top             =   540
  40.          Width           =   915
  41.       End
  42.       Begin VB.Label Label6 
  43.          Caption         =   "Height:"
  44.          Height          =   195
  45.          Left            =   90
  46.          TabIndex        =   15
  47.          Top             =   810
  48.          Width           =   915
  49.       End
  50.       Begin VB.Label Label5 
  51.          Caption         =   "Width:"
  52.          Height          =   195
  53.          Left            =   90
  54.          TabIndex        =   14
  55.          Top             =   540
  56.          Width           =   825
  57.       End
  58.       Begin VB.Label lblBitDepth 
  59.          Caption         =   "lblBitDepth"
  60.          Height          =   195
  61.          Left            =   1440
  62.          TabIndex        =   13
  63.          Top             =   270
  64.          Width           =   825
  65.       End
  66.       Begin VB.Label Label4 
  67.          Caption         =   "Bit Depth:"
  68.          Height          =   195
  69.          Left            =   90
  70.          TabIndex        =   12
  71.          Top             =   270
  72.          Width           =   1005
  73.       End
  74.    End
  75.    Begin VB.Frame frmJPEGOptions 
  76.       Caption         =   "JPEG and PNG Options"
  77.       Enabled         =   0   'False
  78.       Height          =   2925
  79.       Left            =   3240
  80.       TabIndex        =   6
  81.       Top             =   600
  82.       Width           =   2115
  83.       Begin VB.OptionButton optWriteOptions 
  84.          Caption         =   "Grayscale 8-bit"
  85.          Height          =   255
  86.          Index           =   2
  87.          Left            =   360
  88.          TabIndex        =   3
  89.          Top             =   1200
  90.          Width           =   1455
  91.       End
  92.       Begin VB.OptionButton optWriteOptions 
  93.          Caption         =   "Progressive"
  94.          Height          =   255
  95.          Index           =   1
  96.          Left            =   360
  97.          TabIndex        =   2
  98.          Top             =   840
  99.          Width           =   1215
  100.       End
  101.       Begin VB.OptionButton optWriteOptions 
  102.          Caption         =   "Progressive Grayscale 8-bit"
  103.          Height          =   495
  104.          Index           =   3
  105.          Left            =   360
  106.          TabIndex        =   4
  107.          Top             =   1440
  108.          Width           =   1455
  109.       End
  110.       Begin VB.OptionButton optWriteOptions 
  111.          Caption         =   "None"
  112.          Height          =   255
  113.          Index           =   0
  114.          Left            =   360
  115.          TabIndex        =   1
  116.          Top             =   480
  117.          Width           =   1215
  118.       End
  119.       Begin VB.TextBox txtWriteCompression 
  120.          Height          =   285
  121.          Left            =   1200
  122.          TabIndex        =   5
  123.          Text            =   "txtWriteCompression"
  124.          Top             =   2430
  125.          Width           =   495
  126.       End
  127.       Begin VB.Label Label3 
  128.          Caption         =   "Write Compression (5...100):"
  129.          Height          =   615
  130.          Left            =   120
  131.          TabIndex        =   9
  132.          Top             =   2160
  133.          Width           =   975
  134.       End
  135.       Begin VB.Label Label2 
  136.          Caption         =   "WriteOption:"
  137.          Height          =   255
  138.          Left            =   120
  139.          TabIndex        =   8
  140.          Top             =   240
  141.          Width           =   1095
  142.       End
  143.    End
  144.    Begin VB.ComboBox cmbFileType 
  145.       Height          =   315
  146.       Left            =   3240
  147.       TabIndex        =   0
  148.       Text            =   "cmbFileType"
  149.       Top             =   240
  150.       Width           =   2115
  151.    End
  152.    Begin ik32Lib.Picbuf Picbuf1 
  153.       Height          =   2385
  154.       Left            =   120
  155.       TabIndex        =   10
  156.       TabStop         =   0   'False
  157.       Top             =   0
  158.       Width           =   3015
  159.       _Version        =   65536
  160.       _ExtentX        =   5318
  161.       _ExtentY        =   4207
  162.       _StockProps     =   253
  163.    End
  164.    Begin MSComDlg.CommonDialog CommonDialog1 
  165.       Left            =   4980
  166.       Top             =   360
  167.       _Version        =   65536
  168.       _ExtentX        =   847
  169.       _ExtentY        =   847
  170.       _StockProps     =   0
  171.    End
  172.    Begin VB.Label Label1 
  173.       Caption         =   "Save File As:"
  174.       Height          =   255
  175.       Left            =   3240
  176.       TabIndex        =   7
  177.       Top             =   0
  178.       Width           =   1815
  179.    End
  180.    Begin VB.Menu mnuFile 
  181.       Caption         =   "&File"
  182.       Begin VB.Menu mnuLoad 
  183.          Caption         =   "&Load Image..."
  184.       End
  185.       Begin VB.Menu mnuSave 
  186.          Caption         =   "&Save Image..."
  187.       End
  188.       Begin VB.Menu mnuExit 
  189.          Caption         =   "E&xit"
  190.          Shortcut        =   ^X
  191.       End
  192.    End
  193. Attribute VB_Name = "Form1"
  194. Attribute VB_Creatable = False
  195. Attribute VB_Exposed = False
  196. 'Description: This sub resets all the values of
  197. 'text boxes, labels, and option buttons.
  198. Sub InitControlValues()
  199.     'Init control values
  200.     lblWidth.Caption = Picbuf1.Xresolution
  201.     lblHeight.Caption = Picbuf1.Yresolution
  202.     lblBitDepth.Caption = Picbuf1.ColorDepth
  203.     txtWriteCompression.Text = 0
  204.     optWriteOptions(0).Value = True
  205. End Sub
  206. 'Description: This code determines if the JPEG or PNG file
  207. 'type has been selected or not
  208. Private Sub cmbFileType_Click()
  209.     Select Case UCase(Mid(cmbFileType.Text, Len(cmbFileType.Text) - 2, 3))
  210.         Case "PEG", "PNG", "UTO"
  211.             frmJPEGOptions.Enabled = True
  212.             txtWriteCompression.Text = 100
  213.         Case Else
  214.             optWriteOptions(0).Value = True
  215.             txtWriteCompression = 0
  216.             frmJPEGOptions.Enabled = False
  217.     End Select
  218. End Sub
  219. 'Description: This code initializes all preset
  220. 'values
  221. Private Sub Form_Load()
  222.     'Add data to image type combo box
  223.     InitcmbImageFormat cmbFileType
  224.     InitPicbuf Picbuf1, True, "balloon.bmp"
  225.     InitControlValues
  226. End Sub
  227. 'Description: This code exits the program
  228. Private Sub mnuExit_Click()
  229.     ExitProgram
  230. End Sub
  231. 'Description: This code uses the Common Dialog
  232. 'control to select a file name, and then loads that
  233. 'image into the picbuf
  234. Private Sub mnuLoad_Click()
  235.     LoadImage Picbuf1, CommonDialog1
  236.     InitControlValues
  237. End Sub
  238. 'Description: This code determines which file type
  239. 'has been selected, and then, using the Common
  240. 'Dialog control, saves the image under a specified
  241. 'file name
  242. Private Sub mnuSave_Click()
  243.     'set image format type
  244.     Picbuf1.ImageFormat = Val(Left(cmbFileType, 1))
  245.     If Picbuf1.WriteOption > 1 Then
  246.         Picbuf1.GrayScale
  247.     End If
  248.     SaveImage Picbuf1, CommonDialog1
  249.     lblBitDepth.Caption = Picbuf1.ColorDepth
  250. End Sub
  251. 'Description: This code sets the Write Option for
  252. 'the picbuf control depending on which option
  253. 'button has been chosen
  254. Private Sub optWriteOptions_Click(Index As Integer)
  255.     Picbuf1.WriteOption = Index
  256. End Sub
  257. 'Description: This code changes the WriteCompression
  258. 'property
  259. Private Sub txtWriteCompression_Change()
  260.     Picbuf1.WriteCompression = Val(txtWriteCompression.Text)
  261. End Sub
  262.