home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- BorderStyle = 1 'Fixed Single
- Caption = "Optimize Palette Files"
- ClientHeight = 7215
- ClientLeft = 1770
- ClientTop = 2040
- ClientWidth = 7710
- Height = 7995
- Left = 1710
- LinkTopic = "Form1"
- LockControls = -1 'True
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 7215
- ScaleWidth = 7710
- Top = 1320
- Width = 7830
- Begin VB.TextBox txtLocPB1
- Height = 315
- Left = 120
- TabIndex = 17
- Text = "txtLocPB1"
- Top = 0
- Width = 4335
- End
- Begin VB.TextBox cd4
- Height = 285
- Left = 6180
- TabIndex = 13
- Text = "cd4"
- Top = 6840
- Width = 435
- End
- Begin VB.TextBox cd3
- Height = 285
- Left = 3660
- TabIndex = 12
- Text = "cd3"
- Top = 6840
- Width = 435
- End
- Begin VB.TextBox cd2
- Height = 285
- Left = 1140
- TabIndex = 11
- Text = "cd2"
- Top = 6840
- Width = 435
- End
- Begin VB.TextBox cd1
- Height = 285
- Left = 1140
- TabIndex = 9
- Text = "cd1"
- Top = 3840
- Width = 435
- End
- Begin VB.TextBox txtLocPB3
- Height = 315
- Left = 2640
- TabIndex = 4
- Text = "txtLocPB3"
- Top = 4200
- Width = 2415
- End
- Begin VB.TextBox txtLocPB4
- Height = 315
- Left = 5160
- TabIndex = 3
- Text = "txtLocPB4"
- Top = 4200
- Width = 2415
- End
- Begin VB.TextBox txtLocPB2
- Height = 315
- Left = 120
- TabIndex = 2
- Text = "txtLocPB2"
- Top = 4200
- Width = 2415
- End
- Begin VB.CommandButton cmdOptimFiles
- Caption = "OptimizePal&Files"
- Height = 315
- Left = 6120
- TabIndex = 1
- Top = 0
- Width = 1455
- End
- Begin VB.CommandButton cmdOptim
- Caption = "&OptimizePal"
- Height = 315
- Left = 4560
- TabIndex = 0
- Top = 0
- Width = 1455
- End
- Begin ik32Lib.Picbuf PicbufSrc3
- Height = 2175
- Left = 5160
- TabIndex = 8
- Top = 4560
- Width = 2415
- _Version = 65536
- _ExtentX = 4260
- _ExtentY = 3836
- _StockProps = 253
- End
- Begin ik32Lib.Picbuf PicbufSrc2
- Height = 2175
- Left = 2640
- TabIndex = 7
- Top = 4560
- Width = 2415
- _Version = 65536
- _ExtentX = 4260
- _ExtentY = 3836
- _StockProps = 253
- End
- Begin ik32Lib.Picbuf PicbufSrc1
- Height = 2175
- Left = 90
- TabIndex = 6
- Top = 4590
- Width = 2415
- _Version = 65536
- _ExtentX = 4260
- _ExtentY = 3836
- _StockProps = 253
- End
- Begin ik32Lib.Picbuf PicbufDest
- Height = 3375
- Left = 120
- TabIndex = 5
- Top = 360
- Width = 7455
- _Version = 65536
- _ExtentX = 13150
- _ExtentY = 5953
- _StockProps = 253
- End
- Begin MSComDlg.CommonDialog CommonDialog1
- Left = 2070
- Top = 3780
- _Version = 65536
- _ExtentX = 847
- _ExtentY = 847
- _StockProps = 0
- End
- Begin VB.Label Label4
- Caption = "Color Depth:"
- Height = 195
- Left = 5160
- TabIndex = 16
- Top = 6900
- Width = 975
- End
- Begin VB.Label Label3
- Caption = "Color Depth:"
- Height = 195
- Left = 2640
- TabIndex = 15
- Top = 6900
- Width = 975
- End
- Begin VB.Label Label2
- Caption = "Color Depth:"
- Height = 195
- Left = 120
- TabIndex = 14
- Top = 6900
- Width = 975
- End
- Begin VB.Label Label1
- Caption = "Color Depth:"
- Height = 195
- Left = 120
- TabIndex = 10
- Top = 3900
- Width = 975
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuLoadDest
- Caption = "&Load Destination Image..."
- End
- Begin VB.Menu mnuLoadSrc1
- Caption = "Load Source &1 Image..."
- End
- Begin VB.Menu mnuLoadSrc2
- Caption = "Load Source &2 Image..."
- End
- Begin VB.Menu mnuLoadSrc3
- Caption = "Load Source &3 Image..."
- End
- Begin VB.Menu mnuSaveDest
- Caption = "&Save Destination Image..."
- End
- Begin VB.Menu mnuSpacer
- Caption = "-"
- End
- Begin VB.Menu mnuExit
- Caption = "E&xit"
- Shortcut = ^X
- End
- End
- Begin VB.Menu mnuReload
- Caption = "&Reload"
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Dim PBControls(1 To 3) As Object
- Dim Files(1 To 3) As String
- 'Description: This sub sets up an array of picbufs
- Sub SetupControls()
- Set PBControls(1) = PicbufSrc1
- Set PBControls(2) = PicbufSrc2
- Set PBControls(3) = PicbufSrc3
- End Sub
- 'Description: This code sets up an array of files
- 'to be used with OptimizePalFiles
- Sub SetupFiles()
- Files(1) = App.Path + "\..\images\rgb8.bmp"
- Files(2) = App.Path + "\..\images\white8.bmp"
- Files(3) = App.Path + "\..\images\cat8.bmp"
- End Sub
- 'Description: This code optimizes the palette of the
- 'destination picbuf.
- Private Sub cmdOptim_Click()
- PicbufDest.OptimizePal PBControls, 3, 100
- End Sub
- 'Description: This code optimizes the destination
- 'image to three files specified in the sub
- 'SetupFiles
- Private Sub cmdOptimFiles_Click()
- PicbufDest.OptimizePalFiles PBControls, 3, Files, 3, 100
- End Sub
- 'Description: This code loads images into the
- 'picbufs, and sets default values for labels,
- 'and text boxes.
- Private Sub Form_Load()
- InitPicbuf PicbufDest, True, "marybeth.tif"
- InitPicbuf PicbufSrc1, True, "leaves8.pcx"
- InitPicbuf PicbufSrc2, True, "bambi1.bmp"
- InitPicbuf PicbufSrc3, True, "winlogo1.bmp"
- txtLocPB1.Text = PicbufDest.Filename
- txtLocPB2.Text = PicbufSrc1.Filename
- txtLocPB3.Text = PicbufSrc2.Filename
- txtLocPB4.Text = PicbufSrc3.Filename
- cd1.Text = Str$(PicbufDest.ColorDepth)
- cd2.Text = Str$(PicbufSrc1.ColorDepth)
- cd3.Text = Str$(PicbufSrc2.ColorDepth)
- cd4.Text = Str$(PicbufSrc3.ColorDepth)
- SetupFiles
- SetupControls
- End Sub
- 'Description: This ends the program.
- Private Sub mnuExit_Click()
- ExitProgram
- End Sub
- 'Description: This code loads an image into the
- 'picbuf using the common dialog control.
- Private Sub mnuLoadDest_Click()
- LoadImage PicbufDest, CommonDialog1
- cd1.Text = Str$(PicbufDest.ColorDepth)
- txtLocPB1.Text = PicbufDest.Filename
- End Sub
- 'Description: This code loads an image into the
- 'picbuf using the common dialog control.
- Private Sub mnuLoadSrc1_Click()
- LoadImage PicbufSrc1, CommonDialog1
- cd2.Text = Str$(PicbufSrc1.ColorDepth)
- txtLocPB2.Text = PicbufSrc1.Filename
- End Sub
- 'Description: This code loads an image into the
- 'picbuf using the common dialog control.
- Private Sub mnuLoadSrc2_Click()
- LoadImage PicbufSrc2, CommonDialog1
- cd3.Text = Str$(PicbufSrc2.ColorDepth)
- txtLocPB3.Text = PicbufSrc2.Filename
- End Sub
- 'Description: This code loads an image into the
- 'picbuf using the common dialog control.
- Private Sub mnuLoadSrc3_Click()
- LoadImage PicbufSrc3, CommonDialog1
- cd4.Text = Str$(PicbufSrc3.ColorDepth)
- txtLocPB4.Text = PicbufSrc3.Filename
- End Sub
- 'Description: This code reloads the image in the
- 'destination picbuf.
- Private Sub mnuReload_Click()
- PicbufDest.Load
- End Sub
- 'Description: This code saves the image in the
- 'picbuf using the common dialog control.
- Private Sub mnuSaveDest_Click()
- SaveImage PicbufDest, CommonDialog1
- End Sub
-