home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Visual C++ Utilities / i Mag 2.0 / caImagX.CAB / frmTest.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2003-04-13  |  41.5 KB  |  1,261 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Object = "{26128CCE-6170-11D7-B22B-BCE241A42133}#11.1#0"; "caImagX.ocx"
  4. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  5. Begin VB.Form frmTest 
  6.    Caption         =   "TEST"
  7.    ClientHeight    =   6510
  8.    ClientLeft      =   150
  9.    ClientTop       =   720
  10.    ClientWidth     =   9480
  11.    BeginProperty Font 
  12.       Name            =   "Verdana"
  13.       Size            =   8.25
  14.       Charset         =   0
  15.       Weight          =   400
  16.       Underline       =   0   'False
  17.       Italic          =   0   'False
  18.       Strikethrough   =   0   'False
  19.    EndProperty
  20.    Icon            =   "frmTest.frx":0000
  21.    LinkTopic       =   "Form1"
  22.    LockControls    =   -1  'True
  23.    MaxButton       =   0   'False
  24.    ScaleHeight     =   6510
  25.    ScaleWidth      =   9480
  26.    Begin MSComctlLib.Slider sldBright 
  27.       Height          =   345
  28.       Left            =   7950
  29.       TabIndex        =   21
  30.       Top             =   4830
  31.       Width           =   1560
  32.       _ExtentX        =   2752
  33.       _ExtentY        =   609
  34.       _Version        =   393216
  35.       Max             =   100
  36.       TickStyle       =   3
  37.    End
  38.    Begin VB.PictureBox piColor 
  39.       Appearance      =   0  'Flat
  40.       BackColor       =   &H00000000&
  41.       ForeColor       =   &H80000008&
  42.       Height          =   300
  43.       Index           =   2
  44.       Left            =   7740
  45.       ScaleHeight     =   270
  46.       ScaleWidth      =   270
  47.       TabIndex        =   19
  48.       Top             =   840
  49.       Width           =   300
  50.    End
  51.    Begin VB.PictureBox piColor 
  52.       Appearance      =   0  'Flat
  53.       BackColor       =   &H00FFFFFF&
  54.       ForeColor       =   &H80000008&
  55.       Height          =   300
  56.       Index           =   1
  57.       Left            =   9060
  58.       ScaleHeight     =   270
  59.       ScaleWidth      =   270
  60.       TabIndex        =   18
  61.       Top             =   480
  62.       Width           =   300
  63.    End
  64.    Begin VB.PictureBox piColor 
  65.       Appearance      =   0  'Flat
  66.       BackColor       =   &H00000000&
  67.       ForeColor       =   &H80000008&
  68.       Height          =   300
  69.       Index           =   0
  70.       Left            =   7740
  71.       ScaleHeight     =   270
  72.       ScaleWidth      =   270
  73.       TabIndex        =   17
  74.       Top             =   480
  75.       Width           =   300
  76.    End
  77.    Begin VB.PictureBox piPal 
  78.       Appearance      =   0  'Flat
  79.       AutoRedraw      =   -1  'True
  80.       ForeColor       =   &H80000008&
  81.       Height          =   2430
  82.       Left            =   6960
  83.       ScaleHeight     =   2400
  84.       ScaleWidth      =   2400
  85.       TabIndex        =   16
  86.       Top             =   1710
  87.       Width           =   2430
  88.    End
  89.    Begin VB.PictureBox pi0 
  90.       BackColor       =   &H8000000C&
  91.       Height          =   5760
  92.       Left            =   60
  93.       ScaleHeight     =   5700
  94.       ScaleWidth      =   6750
  95.       TabIndex        =   12
  96.       Top             =   420
  97.       Width           =   6810
  98.       Begin VB.PictureBox pi00 
  99.          BorderStyle     =   0  'None
  100.          Height          =   300
  101.          Left            =   6495
  102.          ScaleHeight     =   300
  103.          ScaleWidth      =   300
  104.          TabIndex        =   20
  105.          Top             =   5445
  106.          Width           =   300
  107.       End
  108.       Begin VB.Timer tmrUndo 
  109.          Enabled         =   0   'False
  110.          Interval        =   100
  111.          Left            =   90
  112.          Top             =   870
  113.       End
  114.       Begin VB.VScrollBar vscr0 
  115.          Height          =   5445
  116.          Left            =   6510
  117.          Max             =   7
  118.          Min             =   1
  119.          TabIndex        =   14
  120.          Top             =   0
  121.          Value           =   4
  122.          Width           =   240
  123.       End
  124.       Begin VB.HScrollBar hscr0 
  125.          Height          =   240
  126.          Left            =   0
  127.          Max             =   7
  128.          Min             =   1
  129.          TabIndex        =   13
  130.          Top             =   5460
  131.          Value           =   4
  132.          Width           =   6495
  133.       End
  134.       Begin caImagXP.imaG piX 
  135.          Height          =   900
  136.          Left            =   360
  137.          TabIndex        =   15
  138.          Top             =   210
  139.          Visible         =   0   'False
  140.          Width           =   900
  141.          _ExtentX        =   1588
  142.          _ExtentY        =   1588
  143.          BackColor       =   -2147483636
  144.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  145.             Name            =   "Verdana"
  146.             Size            =   8.25
  147.             Charset         =   0
  148.             Weight          =   400
  149.             Underline       =   0   'False
  150.             Italic          =   0   'False
  151.             Strikethrough   =   0   'False
  152.          EndProperty
  153.          Picture         =   "frmTest.frx":0442
  154.       End
  155.    End
  156.    Begin MSComDlg.CommonDialog CD 
  157.       Left            =   8580
  158.       Top             =   870
  159.       _ExtentX        =   847
  160.       _ExtentY        =   847
  161.       _Version        =   393216
  162.       CancelError     =   -1  'True
  163.       Filter          =   "Bmp file |*.bmp|Gif file|*.gif|Jpg file|*.jpg|Tif file|*.tif"
  164.    End
  165.    Begin MSComctlLib.ImageList IL 
  166.       Left            =   8370
  167.       Top             =   960
  168.       _ExtentX        =   1005
  169.       _ExtentY        =   1005
  170.       BackColor       =   -2147483643
  171.       ImageWidth      =   16
  172.       ImageHeight     =   16
  173.       MaskColor       =   12632256
  174.       _Version        =   393216
  175.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  176.          NumListImages   =   14
  177.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  178.             Picture         =   "frmTest.frx":0498
  179.             Key             =   "open"
  180.          EndProperty
  181.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  182.             Picture         =   "frmTest.frx":05F4
  183.             Key             =   "save"
  184.          EndProperty
  185.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  186.             Picture         =   "frmTest.frx":0B90
  187.             Key             =   "capture"
  188.          EndProperty
  189.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  190.             Picture         =   "frmTest.frx":112C
  191.             Key             =   "erase"
  192.          EndProperty
  193.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  194.             Picture         =   "frmTest.frx":16C8
  195.             Key             =   "fill"
  196.          EndProperty
  197.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  198.             Picture         =   "frmTest.frx":1C64
  199.             Key             =   "line"
  200.          EndProperty
  201.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  202.             Picture         =   "frmTest.frx":2200
  203.             Key             =   "pen"
  204.          EndProperty
  205.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  206.             Picture         =   "frmTest.frx":279C
  207.             Key             =   "select"
  208.          EndProperty
  209.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  210.             Picture         =   "frmTest.frx":2D38
  211.             Key             =   "rectangle"
  212.          EndProperty
  213.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  214.             Picture         =   "frmTest.frx":32D4
  215.             Key             =   "ellipse"
  216.          EndProperty
  217.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  218.             Picture         =   "frmTest.frx":3870
  219.             Key             =   "undo"
  220.          EndProperty
  221.          BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  222.             Picture         =   "frmTest.frx":3E0C
  223.             Key             =   "redo"
  224.          EndProperty
  225.          BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  226.             Picture         =   "frmTest.frx":43A8
  227.             Key             =   "arrow"
  228.          EndProperty
  229.          BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  230.             Picture         =   "frmTest.frx":4944
  231.             Key             =   "color"
  232.          EndProperty
  233.       EndProperty
  234.    End
  235.    Begin MSComctlLib.StatusBar stb0 
  236.       Align           =   2  'Align Bottom
  237.       Height          =   240
  238.       Left            =   0
  239.       TabIndex        =   10
  240.       Top             =   6270
  241.       Width           =   9480
  242.       _ExtentX        =   16722
  243.       _ExtentY        =   423
  244.       _Version        =   393216
  245.       BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
  246.          NumPanels       =   5
  247.          BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  248.             Object.Width           =   2646
  249.             MinWidth        =   2646
  250.          EndProperty
  251.          BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  252.             Object.Width           =   3616
  253.             MinWidth        =   3616
  254.          EndProperty
  255.          BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  256.             Object.Width           =   2822
  257.             MinWidth        =   2822
  258.          EndProperty
  259.          BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  260.             Object.Width           =   3528
  261.             MinWidth        =   3528
  262.          EndProperty
  263.          BeginProperty Panel5 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  264.             AutoSize        =   1
  265.             Object.Width           =   3493
  266.          EndProperty
  267.       EndProperty
  268.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  269.          Name            =   "Verdana"
  270.          Size            =   7.5
  271.          Charset         =   0
  272.          Weight          =   400
  273.          Underline       =   0   'False
  274.          Italic          =   0   'False
  275.          Strikethrough   =   0   'False
  276.       EndProperty
  277.    End
  278.    Begin MSComctlLib.Toolbar tlb0 
  279.       Align           =   1  'Align Top
  280.       Height          =   360
  281.       Left            =   0
  282.       TabIndex        =   9
  283.       Top             =   0
  284.       Width           =   9480
  285.       _ExtentX        =   16722
  286.       _ExtentY        =   635
  287.       ButtonWidth     =   609
  288.       ButtonHeight    =   582
  289.       Appearance      =   1
  290.       Style           =   1
  291.       ImageList       =   "IL"
  292.       _Version        =   393216
  293.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  294.          NumButtons      =   19
  295.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  296.             Key             =   "open"
  297.             Object.ToolTipText     =   "Open"
  298.          EndProperty
  299.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  300.             Enabled         =   0   'False
  301.             Key             =   "save"
  302.             Object.ToolTipText     =   "Save"
  303.          EndProperty
  304.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  305.             Key             =   "sep0"
  306.             Style           =   3
  307.          EndProperty
  308.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  309.             Enabled         =   0   'False
  310.             Key             =   "undo"
  311.             Object.ToolTipText     =   "Undo"
  312.          EndProperty
  313.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  314.             Enabled         =   0   'False
  315.             Key             =   "redo"
  316.             Object.ToolTipText     =   "Redo"
  317.          EndProperty
  318.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  319.             Key             =   "sep1"
  320.             Style           =   3
  321.          EndProperty
  322.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  323.             Enabled         =   0   'False
  324.             Key             =   "draw"
  325.             Object.ToolTipText     =   "Draw Mode"
  326.             Style           =   1
  327.             Value           =   1
  328.          EndProperty
  329.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  330.             Key             =   "sep2"
  331.             Style           =   3
  332.          EndProperty
  333.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  334.             Enabled         =   0   'False
  335.             Key             =   "select"
  336.             Object.ToolTipText     =   "Select"
  337.             Style           =   1
  338.          EndProperty
  339.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  340.             Enabled         =   0   'False
  341.             Key             =   "pen"
  342.             Object.ToolTipText     =   "Pen"
  343.             Style           =   1
  344.          EndProperty
  345.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  346.             Enabled         =   0   'False
  347.             Key             =   "line"
  348.             Object.ToolTipText     =   "Line"
  349.             Style           =   1
  350.          EndProperty
  351.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  352.             Enabled         =   0   'False
  353.             Key             =   "rectangle"
  354.             Object.ToolTipText     =   "Rectangle"
  355.             Style           =   1
  356.          EndProperty
  357.          BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  358.             Enabled         =   0   'False
  359.             Key             =   "ellipse"
  360.             Object.ToolTipText     =   "Ellipse"
  361.             Style           =   1
  362.          EndProperty
  363.          BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  364.             Key             =   "sep3"
  365.             Style           =   3
  366.          EndProperty
  367.          BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  368.             Enabled         =   0   'False
  369.             Key             =   "fill"
  370.             Object.ToolTipText     =   "Fill"
  371.             Style           =   1
  372.          EndProperty
  373.          BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  374.             Enabled         =   0   'False
  375.             Key             =   "erase"
  376.             Object.ToolTipText     =   "Erase"
  377.             Style           =   1
  378.          EndProperty
  379.          BeginProperty Button17 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  380.             Enabled         =   0   'False
  381.             Key             =   "capture"
  382.             Object.ToolTipText     =   "Capture"
  383.             Style           =   1
  384.          EndProperty
  385.          BeginProperty Button18 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  386.             Style           =   3
  387.          EndProperty
  388.          BeginProperty Button19 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  389.             Enabled         =   0   'False
  390.             Key             =   "palette"
  391.             Object.ToolTipText     =   "View Palette"
  392.             Object.Tag             =   "color"
  393.          EndProperty
  394.       EndProperty
  395.    End
  396.    Begin VB.ComboBox cbZoom 
  397.       Enabled         =   0   'False
  398.       Height          =   315
  399.       ItemData        =   "frmTest.frx":4AA0
  400.       Left            =   8010
  401.       List            =   "frmTest.frx":4AB6
  402.       Style           =   2  'Dropdown List
  403.       TabIndex        =   0
  404.       Top             =   4290
  405.       Width           =   1425
  406.    End
  407.    Begin MSComctlLib.Slider sldContrast 
  408.       Height          =   345
  409.       Left            =   7950
  410.       TabIndex        =   22
  411.       Top             =   5190
  412.       Width           =   1560
  413.       _ExtentX        =   2752
  414.       _ExtentY        =   609
  415.       _Version        =   393216
  416.       Max             =   100
  417.       TickStyle       =   3
  418.    End
  419.    Begin MSComctlLib.Slider sldGamma 
  420.       Height          =   345
  421.       Left            =   6900
  422.       TabIndex        =   23
  423.       Top             =   5850
  424.       Width           =   2610
  425.       _ExtentX        =   4604
  426.       _ExtentY        =   609
  427.       _Version        =   393216
  428.       Max             =   1000
  429.       TickStyle       =   3
  430.    End
  431.    Begin VB.Label lb0 
  432.       Alignment       =   1  'Right Justify
  433.       Caption         =   "COLORS"
  434.       Height          =   210
  435.       Index           =   4
  436.       Left            =   8190
  437.       TabIndex        =   4
  438.       Top             =   960
  439.       Width           =   1200
  440.    End
  441.    Begin VB.Label lbZoom 
  442.       Caption         =   "Zoom"
  443.       Enabled         =   0   'False
  444.       BeginProperty Font 
  445.          Name            =   "Verdana"
  446.          Size            =   7.5
  447.          Charset         =   0
  448.          Weight          =   400
  449.          Underline       =   0   'False
  450.          Italic          =   0   'False
  451.          Strikethrough   =   0   'False
  452.       EndProperty
  453.       Height          =   210
  454.       Left            =   6990
  455.       TabIndex        =   7
  456.       Top             =   4350
  457.       Width           =   1095
  458.    End
  459.    Begin VB.Label lb0 
  460.       Caption         =   "Palette"
  461.       Height          =   210
  462.       Index           =   0
  463.       Left            =   6960
  464.       TabIndex        =   11
  465.       Top             =   1350
  466.       Width           =   1095
  467.    End
  468.    Begin VB.Label lb0 
  469.       Caption         =   "Fill"
  470.       BeginProperty Font 
  471.          Name            =   "Verdana"
  472.          Size            =   7.5
  473.          Charset         =   0
  474.          Weight          =   400
  475.          Underline       =   0   'False
  476.          Italic          =   0   'False
  477.          Strikethrough   =   0   'False
  478.       EndProperty
  479.       Height          =   210
  480.       Index           =   3
  481.       Left            =   7320
  482.       TabIndex        =   8
  483.       Top             =   870
  484.       Width           =   735
  485.    End
  486.    Begin VB.Label lb0 
  487.       Caption         =   "Right"
  488.       BeginProperty Font 
  489.          Name            =   "Verdana"
  490.          Size            =   7.5
  491.          Charset         =   0
  492.          Weight          =   400
  493.          Underline       =   0   'False
  494.          Italic          =   0   'False
  495.          Strikethrough   =   0   'False
  496.       EndProperty
  497.       Height          =   210
  498.       Index           =   2
  499.       Left            =   8550
  500.       TabIndex        =   6
  501.       Top             =   510
  502.       Width           =   705
  503.    End
  504.    Begin VB.Label lb0 
  505.       Caption         =   "Left"
  506.       BeginProperty Font 
  507.          Name            =   "Verdana"
  508.          Size            =   7.5
  509.          Charset         =   0
  510.          Weight          =   400
  511.          Underline       =   0   'False
  512.          Italic          =   0   'False
  513.          Strikethrough   =   0   'False
  514.       EndProperty
  515.       Height          =   210
  516.       Index           =   1
  517.       Left            =   7320
  518.       TabIndex        =   5
  519.       Top             =   510
  520.       Width           =   735
  521.    End
  522.    Begin VB.Label lbGamma 
  523.       Caption         =   "Gamma ..."
  524.       Enabled         =   0   'False
  525.       BeginProperty Font 
  526.          Name            =   "Verdana"
  527.          Size            =   7.5
  528.          Charset         =   0
  529.          Weight          =   400
  530.          Underline       =   0   'False
  531.          Italic          =   0   'False
  532.          Strikethrough   =   0   'False
  533.       EndProperty
  534.       Height          =   225
  535.       Left            =   6990
  536.       TabIndex        =   3
  537.       Top             =   5640
  538.       Width           =   1275
  539.    End
  540.    Begin VB.Label lbContrast 
  541.       Caption         =   "Contrast ..."
  542.       Enabled         =   0   'False
  543.       BeginProperty Font 
  544.          Name            =   "Verdana"
  545.          Size            =   7.5
  546.          Charset         =   0
  547.          Weight          =   400
  548.          Underline       =   0   'False
  549.          Italic          =   0   'False
  550.          Strikethrough   =   0   'False
  551.       EndProperty
  552.       Height          =   225
  553.       Left            =   6990
  554.       TabIndex        =   2
  555.       Top             =   5250
  556.       Width           =   825
  557.    End
  558.    Begin VB.Label lbBright 
  559.       Caption         =   "Brightness ..."
  560.       Enabled         =   0   'False
  561.       BeginProperty Font 
  562.          Name            =   "Verdana"
  563.          Size            =   7.5
  564.          Charset         =   0
  565.          Weight          =   400
  566.          Underline       =   0   'False
  567.          Italic          =   0   'False
  568.          Strikethrough   =   0   'False
  569.       EndProperty
  570.       Height          =   225
  571.       Left            =   6990
  572.       TabIndex        =   1
  573.       Top             =   4890
  574.       Width           =   945
  575.    End
  576.    Begin VB.Menu mnFile 
  577.       Caption         =   "File"
  578.       Begin VB.Menu mnFile24 
  579.          Caption         =   "Load 24"
  580.       End
  581.       Begin VB.Menu mnFile256 
  582.          Caption         =   "Load 256"
  583.       End
  584.       Begin VB.Menu mnFileGif 
  585.          Caption         =   "Load Gif"
  586.       End
  587.       Begin VB.Menu mnFileJpg 
  588.          Caption         =   "LoadJ pg"
  589.       End
  590.       Begin VB.Menu mnFileSep0 
  591.          Caption         =   "-"
  592.       End
  593.       Begin VB.Menu mnFileOpen 
  594.          Caption         =   "Open"
  595.       End
  596.       Begin VB.Menu mnFileSave 
  597.          Caption         =   "Save"
  598.          Enabled         =   0   'False
  599.       End
  600.    End
  601.    Begin VB.Menu mnEdit 
  602.       Caption         =   "Edit"
  603.       Enabled         =   0   'False
  604.       Begin VB.Menu mnEditCut 
  605.          Caption         =   "Cut"
  606.       End
  607.       Begin VB.Menu mnEditCopy 
  608.          Caption         =   "Copy"
  609.       End
  610.       Begin VB.Menu mnEditPaste 
  611.          Caption         =   "Paste"
  612.       End
  613.       Begin VB.Menu mnEditSep0 
  614.          Caption         =   "-"
  615.       End
  616.       Begin VB.Menu mnEditUndo 
  617.          Caption         =   "Undo"
  618.       End
  619.       Begin VB.Menu mnEditRedo 
  620.          Caption         =   "Redo"
  621.       End
  622.       Begin VB.Menu mnEditSep1 
  623.          Caption         =   "-"
  624.       End
  625.       Begin VB.Menu mnEditDrawMode 
  626.          Caption         =   "Draw Mode"
  627.          Begin VB.Menu mnEditDrawMode0 
  628.             Caption         =   ""
  629.             Index           =   0
  630.          End
  631.       End
  632.       Begin VB.Menu mnEditEditMode 
  633.          Caption         =   "Edit Mode"
  634.          Begin VB.Menu mnEditEditMode0 
  635.             Caption         =   ""
  636.             Index           =   0
  637.          End
  638.       End
  639.       Begin VB.Menu mnEditSep2 
  640.          Caption         =   "-"
  641.       End
  642.       Begin VB.Menu mnEditEffects 
  643.          Caption         =   "Effects"
  644.       End
  645.    End
  646.    Begin VB.Menu mnImage 
  647.       Caption         =   "Image"
  648.       Enabled         =   0   'False
  649.       Begin VB.Menu mnImageMirror 
  650.          Caption         =   "Mirror"
  651.       End
  652.       Begin VB.Menu mnImageFlip 
  653.          Caption         =   "Flip"
  654.       End
  655.       Begin VB.Menu mnImageRotate0 
  656.          Caption         =   "Rotate 90"
  657.       End
  658.       Begin VB.Menu mnImageRotate1 
  659.          Caption         =   "Rotate 270"
  660.       End
  661.       Begin VB.Menu mnImageRotate2 
  662.          Caption         =   "Rotate 180"
  663.       End
  664.    End
  665.    Begin VB.Menu mnColor 
  666.       Caption         =   "Color"
  667.       Enabled         =   0   'False
  668.       Begin VB.Menu mnColorGray 
  669.          Caption         =   "GrayScale"
  670.       End
  671.       Begin VB.Menu mnColorSep0 
  672.          Caption         =   "-"
  673.       End
  674.       Begin VB.Menu mnColorCd24 
  675.          Caption         =   "Color Depth 24"
  676.       End
  677.       Begin VB.Menu mnColorCd8 
  678.          Caption         =   "Color Depth 8"
  679.       End
  680.       Begin VB.Menu mnColorCd4 
  681.          Caption         =   "Color Depth 4"
  682.       End
  683.       Begin VB.Menu mnColorCd1 
  684.          Caption         =   "Color Depth 1"
  685.       End
  686.       Begin VB.Menu mnColorSep1 
  687.          Caption         =   "-"
  688.       End
  689.       Begin VB.Menu mnColorLoadP 
  690.          Caption         =   "Load Palette"
  691.       End
  692.    End
  693. Attribute VB_Name = "frmTest"
  694. Attribute VB_GlobalNameSpace = False
  695. Attribute VB_Creatable = False
  696. Attribute VB_PredeclaredId = True
  697. Attribute VB_Exposed = False
  698. Option Explicit
  699. Private TestPath As String
  700. Private ButtonPressed As Integer
  701. Sub OpenDone()
  702.     Dim n As Integer
  703.     mnFileSave.Enabled = True
  704.     mnEdit.Enabled = True
  705.     mnImage.Enabled = True
  706.     mnColor.Enabled = True
  707.     For n = 1 To tlb0.Buttons.Count
  708.         tlb0.Buttons(n).Enabled = True
  709.     Next
  710.     lbZoom.Enabled = True
  711.     cbZoom.Enabled = True
  712.     sldBright.Enabled = True
  713.     sldContrast.Enabled = True
  714.     sldGamma.Enabled = True
  715.     lbBright.Enabled = True
  716.     lbContrast.Enabled = True
  717.     lbGamma.Enabled = True
  718.     piX.Move (pi0.ScaleWidth - piX.Width) / 2, (pi0.ScaleHeight - piX.Height) / 2
  719.     DoEvents ' show image
  720.     ViewImageData
  721.     piX.Visible = True
  722.     tmrUndo.Enabled = True
  723. End Sub
  724. Sub ResetSliders()
  725.     sldBright.Value = 50
  726.     sldContrast.Value = 50
  727.     sldGamma.Value = 500
  728.     vscr0.Value = 4
  729.     hscr0.Value = 4
  730. End Sub
  731. Sub SelectModeButton(Key As String)
  732.     Dim n As Integer
  733.     For n = 0 To mnEditEditMode0.ubound
  734.         If mnEditEditMode0(n).Tag = Key Then
  735.             mnEditEditMode0_Click (n)
  736.         End If
  737.     Next
  738.     If Key = "draw" Then mnEditDrawMode0_Click (-1)
  739. End Sub
  740. Sub Settings()
  741.     Dim n As Integer
  742.     ' MENU
  743.     For n = 1 To 3
  744.         Load mnEditDrawMode0(mnEditDrawMode0.ubound + 1)
  745.     Next
  746.     mnEditDrawMode0(0).Caption = "Draw Line"
  747.     mnEditDrawMode0(0).Tag = "draw"
  748.     mnEditDrawMode0(1).Caption = "Draw Rectangle"
  749.     mnEditDrawMode0(1).Tag = "draw"
  750.     mnEditDrawMode0(2).Caption = "Draw Circle"
  751.     mnEditDrawMode0(2).Tag = "draw"
  752.     mnEditDrawMode0(3).Caption = "Draw String"
  753.     mnEditDrawMode0(3).Tag = "draw"
  754.     mnEditDrawMode.Tag = "draw"
  755.     For n = 1 To 11
  756.         Load mnEditEditMode0(mnEditEditMode0.ubound + 1)
  757.     Next
  758.         
  759.     mnEditEditMode0(0).Caption = "Select"
  760.     mnEditEditMode0(0).Tag = "select"
  761.     mnEditEditMode0(1).Caption = "Pen"
  762.     mnEditEditMode0(1).Tag = "pen"
  763.     mnEditEditMode0(2).Caption = "Brush"
  764.     mnEditEditMode0(2).Tag = "brush"
  765.     mnEditEditMode0(3).Caption = "Line"
  766.     mnEditEditMode0(3).Tag = "line"
  767.     mnEditEditMode0(4).Caption = "Rectangle"
  768.     mnEditEditMode0(4).Tag = "rectangle"
  769.     mnEditEditMode0(5).Caption = "Round Rectangle"
  770.     mnEditEditMode0(5).Tag = "roundrectangle"
  771.     mnEditEditMode0(6).Caption = "Filled Rectangle"
  772.     mnEditEditMode0(6).Tag = "filledrectangle"
  773.     mnEditEditMode0(7).Caption = "Ellipse"
  774.     mnEditEditMode0(7).Tag = "ellipse"
  775.     mnEditEditMode0(8).Caption = "Filled Ellipse"
  776.     mnEditEditMode0(8).Tag = "filledellipse"
  777.     mnEditEditMode0(9).Caption = "Capture"
  778.     mnEditEditMode0(9).Tag = "capture"
  779.     mnEditEditMode0(10).Caption = "Erase"
  780.     mnEditEditMode0(10).Tag = "erase"
  781.     mnEditEditMode0(11).Caption = "Fill"
  782.     mnEditEditMode0(11).Tag = "fill"
  783.     ' TOOLBAR
  784.     tlb0.Buttons("open").Image = IL.ListImages.Item("open").Index
  785.     tlb0.Buttons("save").Image = IL.ListImages.Item("save").Index
  786.     tlb0.Buttons("undo").Image = IL.ListImages.Item("undo").Index
  787.     tlb0.Buttons("redo").Image = IL.ListImages.Item("redo").Index
  788.     tlb0.Buttons("draw").Image = IL.ListImages.Item("arrow").Index
  789.     tlb0.Buttons("select").Image = IL.ListImages.Item("select").Index
  790.     tlb0.Buttons("pen").Image = IL.ListImages.Item("pen").Index
  791.     tlb0.Buttons("line").Image = IL.ListImages.Item("line").Index
  792.     tlb0.Buttons("rectangle").Image = IL.ListImages.Item("rectangle").Index
  793.     tlb0.Buttons("ellipse").Image = IL.ListImages.Item("ellipse").Index
  794.     tlb0.Buttons("fill").Image = IL.ListImages.Item("fill").Index
  795.     tlb0.Buttons("erase").Image = IL.ListImages.Item("erase").Index
  796.     tlb0.Buttons("capture").Image = IL.ListImages.Item("capture").Index
  797.     tlb0.Buttons("palette").Image = IL.ListImages.Item("color").Index
  798. End Sub
  799. Sub QueryEnabled()
  800.     Dim DrawEnabled As Boolean, EditEnabled As Boolean, SelectAEnabled As Boolean, CutPaste As Boolean
  801.     piX.QueryAction DrawEnabled, EditEnabled, SelectAEnabled, CutPaste
  802.     mnEditCut.Enabled = CutPaste
  803.     mnEditPaste.Enabled = CutPaste
  804.     mnEditEffects.Enabled = DrawEnabled
  805.     sldBright.Enabled = DrawEnabled
  806.     sldContrast.Enabled = DrawEnabled
  807.     sldGamma.Enabled = DrawEnabled
  808.     lbBright.Enabled = DrawEnabled
  809.     lbContrast.Enabled = DrawEnabled
  810.     lbGamma.Enabled = DrawEnabled
  811.     mnColor.Enabled = DrawEnabled
  812.     mnFile.Enabled = DrawEnabled
  813.     mnImage.Enabled = DrawEnabled
  814. End Sub
  815. Private Sub SetSelection(SelMode As String)
  816. On Error GoTo SErr
  817. SErr: If ErrS Then Exit Sub
  818.     Select Case SelMode
  819.         Case "select"
  820.             piX.Mode = caModeEditSelection
  821.         Case "pen"
  822.             piX.Mode = caModeEditPen
  823.         Case "brush"
  824.             piX.EditLineWidth(caBrushWidth) = 4
  825.             piX.Mode = caModeEditBrush
  826.         Case "capture"
  827.             piX.Mode = caModeEditCapture
  828.         Case "erase"
  829.             piX.EditLineWidth(caEraserWidth) = 4
  830.             piX.Mode = caModeEditEraser
  831.         Case "line"
  832.             piX.EditLineWidth(caLineWidth) = 1
  833.             piX.Mode = caModeEditLine
  834.         Case "fill"
  835.             piX.Mode = caModeEditFill
  836.         Case "rectangle"
  837.             piX.EditLineWidth(caRectangleEllipseWidth) = 1
  838.             piX.Mode = caModeEditRectangle
  839.         Case "filledrectangle"
  840.             piX.Mode = caModeEditRectangleFilled
  841.         Case "ellipse"
  842.             piX.EditLineWidth(caRectangleEllipseWidth) = 4
  843.             piX.Mode = caModeEditEllipse
  844.         Case "filledellipse"
  845.             piX.Mode = caModeEditEllipseFilled
  846.         Case "draw0" '"Line"
  847.             piX.DrawLine 200, 200, 1000, 1000, &H0&, False
  848.         Case "draw1" '"Rectangle"
  849.             piX.DrawLine 200, 200, 1000, 1000, , True
  850.         Case "draw2" '"Circle"
  851.             piX.DrawCircle 500, 500, 1000, &HFF&
  852.         Case "draw3" '"String"
  853.             Dim Fnt As New StdFont
  854.             Fnt.Name = "Verdana"
  855.             Fnt.Size = 14
  856.             piX.DrawString "This is a new string", 200, 200, &HFFFFFF, Fnt
  857.     End Select
  858.     QueryEnabled
  859. End Sub
  860. Private Sub cbZoom_Click()
  861. On Error GoTo SErr
  862. SErr: If ErrS Then Exit Sub
  863.     Select Case cbZoom.ListIndex
  864.         Case 0: piX.Zoom = 0.25
  865.         Case 1: piX.Zoom = 0.5
  866.         Case 2: piX.Zoom = 1
  867.         Case 3: piX.Zoom = 2
  868.         Case 4: piX.Zoom = 3
  869.         Case 5: piX.Zoom = 4
  870.     End Select
  871.     vscr0.Value = 3: hscr0.Value = 3
  872.     vscr0.Value = 4: hscr0.Value = 4
  873. End Sub
  874. Private Sub ViewImageData()
  875. On Error GoTo SErr
  876. SErr: If ErrS Then Exit Sub
  877.     Dim pal() As Long, i As Long, ii As Long, cnt As Long
  878.     Const DD = 150
  879.     piPal.Cls
  880.     If piX.GetPalette(pal) Then
  881.         For ii = 0 To 15
  882.             For i = 0 To 15
  883.                 If cnt <= UBound(pal) Then
  884.                     piPal.Line (i * DD, ii * DD)-((i * DD) + DD, (ii * DD) + DD), pal(cnt), BF
  885.                 End If
  886.                 cnt = cnt + 1
  887.             Next
  888.         Next
  889.     End If
  890.     If piX.ColorDepth = caRGB Then
  891.         stb0.Panels(2).Text = "Color Mode: RGB"
  892.     Else
  893.         stb0.Panels(2).Text = "Color Mode: Palette"
  894.     End If
  895.     stb0.Panels(3).Text = "Color Depth: " & piX.ColorDepth
  896.     stb0.Panels(4).Text = "Color Count: " & Format(piX.ColorCount, "#,##0")
  897.     stb0.Panels(5).Text = "X: " & Format(piX.ImageResolutionX, "#,##0") & " - Y: " & Format(piX.ImageResolutionY, "#,##0")
  898. End Sub
  899. Private Sub Form_Load()
  900. On Error GoTo SErr
  901. SErr: If ErrS Then Exit Sub
  902.     TestPath = App.Path
  903.     Settings
  904.     stb0.Panels(1).Text = "Mode: Draw"
  905.     Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2, 9600, 7200
  906. End Sub
  907. Private Sub hscr0_Change()
  908. On Error GoTo SErr
  909. SErr: If ErrS Then Exit Sub
  910.     piX.Left = ((pi0.ScaleWidth - piX.Width) / 2) - ((hscr0.Value - 4) * 1500)
  911.     pi0.SetFocus
  912. End Sub
  913. Private Sub sldBright_Change()
  914. On Error GoTo SErr
  915. SErr: If ErrS Then Exit Sub
  916.     If sldBright <> 50 Then sldBright_Scroll
  917. End Sub
  918. Private Sub sldBright_LostFocus()
  919. On Error GoTo SErr
  920. SErr: If ErrS Then Exit Sub
  921.     ViewImageData
  922. End Sub
  923. Private Sub sldBright_Scroll()
  924. On Error GoTo SErr
  925. SErr: If ErrS Then Exit Sub
  926.     piX.Brightness sldBright
  927.     DoEvents
  928. End Sub
  929. Private Sub sldContrast_Change()
  930. On Error GoTo SErr
  931. SErr: If ErrS Then Exit Sub
  932.     If sldContrast <> 50 Then sldContrast_Scroll
  933. End Sub
  934. Private Sub sldContrast_LostFocus()
  935. On Error GoTo SErr
  936. SErr: If ErrS Then Exit Sub
  937.     ViewImageData
  938. End Sub
  939. Private Sub sldContrast_Scroll()
  940. On Error GoTo SErr
  941. SErr: If ErrS Then Exit Sub
  942.     piX.Contrast sldContrast
  943.     DoEvents
  944. End Sub
  945. Private Sub sldGamma_Change()
  946. On Error GoTo SErr
  947. SErr: If ErrS Then Exit Sub
  948.     If sldGamma <> 500 Then sldGamma_Scroll
  949. End Sub
  950. Private Sub sldGamma_LostFocus()
  951. On Error GoTo SErr
  952. SErr: If ErrS Then Exit Sub
  953.     ViewImageData
  954. End Sub
  955. Private Sub sldGamma_Scroll()
  956. On Error GoTo SErr
  957. SErr: If ErrS Then Exit Sub
  958.     piX.Gamma sldGamma
  959.     DoEvents
  960. End Sub
  961. Function ErrS() As Boolean
  962.     ErrS = False
  963.     If Err.Number <> 0 Then
  964.         MsgBox "Error with number: " & Format(Err.Number, "#,##0") & vbCr & vbCr & Err.Description, vbCritical, "ERROR"
  965.         ErrS = True
  966.         Err.Clear
  967.     End If
  968. End Function
  969. Private Sub mnColorLoadP_Click()
  970. On Error GoTo SErr
  971. SErr: If ErrS Then Exit Sub
  972.     Dim vPal(255) As Long, n As Integer
  973.     piX.Undo_Add "change palette"
  974.     For n = 0 To 255
  975.         vPal(n) = n
  976.     Next
  977.     piX.SetPalette caPalModeCustom, vPal()
  978.     piX.Undo_AddPalette
  979.     ViewImageData
  980. End Sub
  981. Private Sub mnEditCopy_Click()
  982. On Error GoTo SErr
  983. SErr: If ErrS Then Exit Sub
  984.     piX.Copy
  985. End Sub
  986. Private Sub mnEditCut_Click()
  987. On Error GoTo SErr
  988. SErr: If ErrS Then Exit Sub
  989.     piX.Cut
  990. End Sub
  991. Private Sub mnEditDrawMode0_Click(Index As Integer)
  992. On Error GoTo SErr
  993. SErr: If ErrS Then Exit Sub
  994.     Dim n As Integer
  995.     For n = 0 To mnEditEditMode0.ubound
  996.         mnEditEditMode0(n).Checked = False
  997.     Next
  998.     For n = 1 To tlb0.Buttons.Count
  999.         tlb0.Buttons(n).Value = tbrUnpressed
  1000.     Next
  1001.     tlb0.Buttons("draw").Value = tbrPressed
  1002.     piX.Mode = caModeDraw
  1003.     SetSelection "draw" & Index
  1004.     stb0.Panels(1).Text = "Mode: Draw"
  1005. End Sub
  1006. Private Sub mnEditEditMode0_Click(Index As Integer)
  1007. On Error GoTo SErr
  1008. SErr: If ErrS Then Exit Sub
  1009.     Dim n As Integer
  1010.     For n = 0 To mnEditDrawMode0.ubound
  1011.         mnEditDrawMode0(n).Checked = False
  1012.     Next
  1013.     For n = 0 To mnEditEditMode0.ubound
  1014.         mnEditEditMode0(n).Checked = False
  1015.     Next
  1016.     For n = 1 To tlb0.Buttons.Count
  1017.         tlb0.Buttons(n).Value = tbrUnpressed
  1018.     Next
  1019.     mnEditEditMode0(Index).Checked = True
  1020.     For n = 1 To tlb0.Buttons.Count
  1021.         If tlb0.Buttons(n).Key = mnEditEditMode0(Index).Tag Then
  1022.             tlb0.Buttons(n).Value = tbrPressed
  1023.         End If
  1024.     Next
  1025.     SetSelection mnEditEditMode0(Index).Tag
  1026.     stb0.Panels(1).Text = "Mode: Edit"
  1027. End Sub
  1028. Private Sub mnEditEffects_Click()
  1029. On Error GoTo SErr
  1030. SErr: If ErrS Then Exit Sub
  1031.     Dim lDepth As Long, f As New frmEffects
  1032.     lDepth = piX.ColorDepth
  1033.     f.Show 1
  1034.     If f.ChangePalette Then
  1035.         'piX.SetPaletteFromImage  ' Refreshs palette from soften and sharpen
  1036.         piX.SetImageFromPalette    ' Refreshs palette from soften and sharpen
  1037.     End If
  1038.     ViewImageData
  1039. End Sub
  1040. Private Sub mnEditPaste_Click()
  1041. On Error GoTo SErr
  1042. SErr: If ErrS Then Exit Sub
  1043.     piX.Paste
  1044. End Sub
  1045. Private Sub mnFile24_Click()
  1046. On Error GoTo SErr
  1047. SErr: If ErrS Then Exit Sub
  1048.     ResetSliders
  1049.     piX.LoadPicture TestPath & "\TestB24.bmp"
  1050.     OpenDone
  1051. End Sub
  1052. Private Sub mnFile256_Click()
  1053. On Error GoTo SErr
  1054. SErr: If ErrS Then Exit Sub
  1055.     ResetSliders
  1056.     piX.LoadPicture TestPath & "\TestB256.bmp"
  1057.     OpenDone
  1058. End Sub
  1059. Private Sub mnColorCd24_Click()
  1060. On Error GoTo SErr
  1061. SErr: If ErrS Then Exit Sub
  1062.     piX.ColorDepth = caRGB
  1063.     ViewImageData
  1064. End Sub
  1065. Private Sub mnColorCd8_Click()
  1066. On Error GoTo SErr
  1067. SErr: If ErrS Then Exit Sub
  1068.     piX.ColorDepth = caPal256
  1069.     ViewImageData
  1070. End Sub
  1071. Private Sub mnColorCd4_Click()
  1072. On Error GoTo SErr
  1073. SErr: If ErrS Then Exit Sub
  1074.     piX.ColorDepth = caPal16
  1075.     ViewImageData
  1076. End Sub
  1077. Private Sub mnColorCd1_Click()
  1078. On Error GoTo SErr
  1079. SErr: If ErrS Then Exit Sub
  1080.     piX.ColorDepth = caPal2
  1081.     ViewImageData
  1082. End Sub
  1083. Private Sub mnImageFlip_Click()
  1084. On Error GoTo SErr
  1085. SErr: If ErrS Then Exit Sub
  1086.     piX.Mirror caMirrorVertical
  1087. End Sub
  1088. Private Sub mnFileGif_Click()
  1089. On Error GoTo SErr
  1090. SErr: If ErrS Then Exit Sub
  1091.     ResetSliders
  1092.     piX.LoadPicture TestPath & "\TestBG.gif"
  1093.     OpenDone
  1094. End Sub
  1095. Private Sub mnColorGray_Click()
  1096. On Error GoTo SErr
  1097. SErr: If ErrS Then Exit Sub
  1098.     piX.Undo_Add "gray scale"
  1099.     piX.GrayScale
  1100.     piX.Undo_AddPalette
  1101.     ViewImageData
  1102. End Sub
  1103. Private Sub mnFileJpg_Click()
  1104. On Error GoTo SErr
  1105. SErr: If ErrS Then Exit Sub
  1106.     ResetSliders
  1107.     piX.LoadPicture TestPath & "\TestBJ.jpg"
  1108.     OpenDone
  1109. End Sub
  1110. Private Sub mnImageMirror_Click()
  1111. On Error GoTo SErr
  1112. SErr: If ErrS Then Exit Sub
  1113.     piX.Mirror caMirrorHorizontal
  1114. End Sub
  1115. Private Sub mnFileOpen_Click()
  1116. On Error GoTo EndS
  1117.     ResetSliders
  1118.     CD.CancelError = True
  1119.     CD.Filter = "All Pictures|*.bmp;*.jpg;*.gif;*.tif"
  1120.     CD.ShowOpen
  1121.     If Trim(CD.FileName) <> "" Then
  1122.         piX.LoadPicture CD.FileName
  1123.         OpenDone
  1124.     End If
  1125. EndS:
  1126.     ' NOP
  1127. End Sub
  1128. Private Sub mnEditRedo_Click()
  1129. On Error GoTo SErr
  1130. SErr: If ErrS Then Exit Sub
  1131.     piX.Undo_Redo
  1132. End Sub
  1133. Private Sub mnImageRotate0_Click()
  1134. On Error GoTo SErr
  1135. SErr: If ErrS Then Exit Sub
  1136.     piX.Rotate 90
  1137. End Sub
  1138. Private Sub mnImageRotate1_Click()
  1139. On Error GoTo SErr
  1140. SErr: If ErrS Then Exit Sub
  1141.     piX.Rotate 270
  1142. End Sub
  1143. Private Sub mnImageRotate2_Click()
  1144. On Error GoTo SErr
  1145. SErr: If ErrS Then Exit Sub
  1146.     piX.Rotate 180
  1147. End Sub
  1148. Private Sub mnFileSave_Click()
  1149. On Error GoTo EndS
  1150.     Dim f As New frmSave
  1151.     f.Show 1
  1152.     If Not f.Cancel Then
  1153.         CD.CancelError = True
  1154.         CD.Filter = "BMP File|*.bmp|GIF File|*.gif|JPG File|*.jpg|TIFF File|*.tif"
  1155.         If f.Extension = "bmp" Then CD.FilterIndex = 1
  1156.         If f.Extension = "gif" Then CD.FilterIndex = 2
  1157.         If f.Extension = "jpg" Then CD.FilterIndex = 3
  1158.         If f.Extension = "tif" Then CD.FilterIndex = 4
  1159.         CD.ShowSave
  1160.         If Trim(CD.FileName) <> "" Then
  1161.             If f.Extension = "bmp" Then
  1162.                 piX.SavePicture Left(CD.FileName, InStr(1, CD.FileName, ".") - 1) & ".bmp", caFileBmp
  1163.             ElseIf f.Extension = "gif" Then
  1164.                 piX.SavePicture Left(CD.FileName, InStr(1, CD.FileName, ".") - 1) & ".gif", caFileGif, , caGifTransparentWhite
  1165.             ElseIf f.Extension = "jpg" Then
  1166.                 piX.SavePicture Left(CD.FileName, InStr(1, CD.FileName, ".") - 1) & ".jpg", caFileJpg, f.Compression
  1167.             ElseIf f.Extension = "tif" Then
  1168.                 piX.SavePicture Left(CD.FileName, InStr(1, CD.FileName, ".") - 1) & ".tif", caFileTif
  1169.             End If
  1170.         End If
  1171.     End If
  1172. EndS:
  1173.     ' NOP
  1174. End Sub
  1175. Private Sub mnEditUndo_Click()
  1176. On Error GoTo SErr
  1177. SErr: If ErrS Then Exit Sub
  1178.     piX.Undo_Undo
  1179. End Sub
  1180. Private Sub piColor_Click(Index As Integer)
  1181. On Error Resume Next
  1182.     CD.ShowColor
  1183.     If Err = 0 Then
  1184.         If Index = 0 Then
  1185.             piX.ForeColor = CD.Color
  1186.             piColor(Index).BackColor = piX.ForeColor
  1187.         ElseIf Index = 1 Then
  1188.             piX.EditColorRight = CD.Color
  1189.             piColor(Index).BackColor = piX.EditColorRight
  1190.         ElseIf Index = 2 Then
  1191.             piX.FillColor = CD.Color
  1192.             piColor(Index).BackColor = piX.FillColor
  1193.         End If
  1194.     End If
  1195. End Sub
  1196. Private Sub piX_CaptureColor(Color As stdole.OLE_COLOR)
  1197. On Error GoTo SErr
  1198. SErr: If ErrS Then Exit Sub
  1199.     If ButtonPressed = 1 Then piX.ForeColor = Color
  1200.     If ButtonPressed = 2 Then piX.EditColorRight = Color
  1201.     piColor(ButtonPressed - 1).BackColor = Color
  1202. End Sub
  1203. Private Sub piX_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  1204. On Error GoTo SErr
  1205. SErr: If ErrS Then Exit Sub
  1206.     ButtonPressed = Button
  1207. End Sub
  1208. Private Sub tlb0_ButtonClick(ByVal Button As MSComctlLib.Button)
  1209. On Error GoTo SErr
  1210. SErr: If ErrS Then Exit Sub
  1211.     Select Case Button.Key
  1212.         Case "open": mnFileOpen_Click
  1213.         Case "save": mnFileSave_Click
  1214.         Case "undo": mnEditUndo_Click
  1215.         Case "redo": mnEditRedo_Click
  1216.         Case "draw": SelectModeButton Button.Key
  1217.         Case "select": SelectModeButton Button.Key
  1218.         Case "pen": SelectModeButton Button.Key
  1219.         Case "line": SelectModeButton Button.Key
  1220.         Case "rectangle": SelectModeButton Button.Key
  1221.         Case "ellipse": SelectModeButton Button.Key
  1222.         Case "fill": SelectModeButton Button.Key
  1223.         Case "erase": SelectModeButton Button.Key
  1224.         Case "capture": SelectModeButton Button.Key
  1225.         Case "palette": ViewImageData
  1226.     End Select
  1227. End Sub
  1228. Private Sub tmrUndo_Timer()
  1229. On Error GoTo SErr
  1230. SErr: If ErrS Then Exit Sub
  1231.     Dim sUndo As String, sRedo As String
  1232.     Dim bUndo As Boolean, bRedo As Boolean
  1233.     piX.Undo_Query sUndo, bUndo, sRedo, bRedo
  1234.     If sUndo <> "" Then
  1235.         mnEditUndo.Caption = "Undo " & sUndo
  1236.         tlb0.Buttons("undo").ToolTipText = "Undo " & sUndo
  1237.     Else
  1238.         mnEditUndo.Caption = "Undo ..."
  1239.         tlb0.Buttons("undo").ToolTipText = "Undo ..."
  1240.         tlb0.Buttons("undo").Enabled = False
  1241.     End If
  1242.     mnEditUndo.Enabled = bUndo
  1243.     tlb0.Buttons("undo").Enabled = bUndo
  1244.     If sRedo <> "" Then
  1245.         mnEditRedo.Caption = "Redo " & sRedo
  1246.         tlb0.Buttons("redo").ToolTipText = "Redo " & sRedo
  1247.     Else
  1248.         mnEditRedo.Caption = "Redo ..."
  1249.         tlb0.Buttons("redo").ToolTipText = "Redo ..."
  1250.         tlb0.Buttons("redo").Enabled = False
  1251.     End If
  1252.     mnEditRedo.Enabled = bRedo
  1253.     tlb0.Buttons("redo").Enabled = bRedo
  1254. End Sub
  1255. Private Sub vscr0_Change()
  1256. On Error GoTo SErr
  1257. SErr: If ErrS Then Exit Sub
  1258.     piX.Top = ((pi0.ScaleHeight - piX.Height) / 2) - ((vscr0.Value - 4) * 1500)
  1259.     pi0.SetFocus
  1260. End Sub
  1261.