home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Power Pack / Visual_Basic4_Power_Pack.bin / vb4files / ilib_vb / mainform.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-11-20  |  60.2 KB  |  1,752 lines

  1. VERSION 4.00
  2. Begin VB.Form MainForm 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "ImageLib 3.1 Example"
  5.    ClientHeight    =   6180
  6.    ClientLeft      =   300
  7.    ClientTop       =   1140
  8.    ClientWidth     =   8745
  9.    ForeColor       =   &H80000008&
  10.    Height          =   6585
  11.    Icon            =   "MAINFORM.frx":0000
  12.    Left            =   240
  13.    LinkTopic       =   "Form2"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   6180
  17.    ScaleWidth      =   8745
  18.    Top             =   795
  19.    Width           =   8865
  20.    Begin VB.PictureBox Picture_B_Aquire 
  21.       AutoSize        =   -1  'True
  22.       Height          =   645
  23.       Index           =   3
  24.       Left            =   10680
  25.       Picture         =   "MAINFORM.frx":030A
  26.       ScaleHeight     =   585
  27.       ScaleWidth      =   945
  28.       TabIndex        =   89
  29.       Top             =   2640
  30.       Width           =   1005
  31.    End
  32.    Begin VB.PictureBox Picture_B_Aquire 
  33.       AutoSize        =   -1  'True
  34.       Height          =   645
  35.       Index           =   2
  36.       Left            =   10440
  37.       Picture         =   "MAINFORM.frx":208C
  38.       ScaleHeight     =   585
  39.       ScaleWidth      =   945
  40.       TabIndex        =   88
  41.       Top             =   2640
  42.       Width           =   1005
  43.    End
  44.    Begin VB.PictureBox Picture_B_Aquire 
  45.       AutoSize        =   -1  'True
  46.       Height          =   645
  47.       Index           =   1
  48.       Left            =   10200
  49.       Picture         =   "MAINFORM.frx":3E0E
  50.       ScaleHeight     =   585
  51.       ScaleWidth      =   945
  52.       TabIndex        =   87
  53.       Top             =   2640
  54.       Width           =   1005
  55.    End
  56.    Begin VB.PictureBox Picture_B_Select 
  57.       AutoSize        =   -1  'True
  58.       Height          =   645
  59.       Index           =   3
  60.       Left            =   10680
  61.       Picture         =   "MAINFORM.frx":5B90
  62.       ScaleHeight     =   585
  63.       ScaleWidth      =   945
  64.       TabIndex        =   86
  65.       Top             =   2040
  66.       Width           =   1005
  67.    End
  68.    Begin VB.PictureBox Picture_B_Select 
  69.       AutoSize        =   -1  'True
  70.       Height          =   645
  71.       Index           =   2
  72.       Left            =   10440
  73.       Picture         =   "MAINFORM.frx":7912
  74.       ScaleHeight     =   585
  75.       ScaleWidth      =   945
  76.       TabIndex        =   85
  77.       Top             =   2040
  78.       Width           =   1005
  79.    End
  80.    Begin VB.PictureBox Picture_B_Select 
  81.       AutoSize        =   -1  'True
  82.       Height          =   645
  83.       Index           =   1
  84.       Left            =   10200
  85.       Picture         =   "MAINFORM.frx":9694
  86.       ScaleHeight     =   585
  87.       ScaleWidth      =   945
  88.       TabIndex        =   84
  89.       Top             =   2040
  90.       Width           =   1005
  91.    End
  92.    Begin VB.PictureBox Picture_B_Setup 
  93.       AutoSize        =   -1  'True
  94.       Height          =   645
  95.       Index           =   3
  96.       Left            =   10680
  97.       Picture         =   "MAINFORM.frx":B416
  98.       ScaleHeight     =   585
  99.       ScaleWidth      =   945
  100.       TabIndex        =   83
  101.       Top             =   1440
  102.       Width           =   1005
  103.    End
  104.    Begin VB.PictureBox Picture_B_Setup 
  105.       AutoSize        =   -1  'True
  106.       Height          =   645
  107.       Index           =   2
  108.       Left            =   10440
  109.       Picture         =   "MAINFORM.frx":D198
  110.       ScaleHeight     =   585
  111.       ScaleWidth      =   945
  112.       TabIndex        =   82
  113.       Top             =   1440
  114.       Width           =   1005
  115.    End
  116.    Begin VB.PictureBox Picture_B_Setup 
  117.       AutoSize        =   -1  'True
  118.       Height          =   645
  119.       Index           =   1
  120.       Left            =   10200
  121.       Picture         =   "MAINFORM.frx":EF1A
  122.       ScaleHeight     =   585
  123.       ScaleWidth      =   945
  124.       TabIndex        =   81
  125.       Top             =   1440
  126.       Width           =   1005
  127.    End
  128.    Begin VB.PictureBox Picture_B_Save 
  129.       AutoSize        =   -1  'True
  130.       Height          =   645
  131.       Index           =   3
  132.       Left            =   10680
  133.       Picture         =   "MAINFORM.frx":10C9C
  134.       ScaleHeight     =   585
  135.       ScaleWidth      =   945
  136.       TabIndex        =   80
  137.       Top             =   840
  138.       Width           =   1005
  139.    End
  140.    Begin VB.PictureBox Picture_B_Save 
  141.       AutoSize        =   -1  'True
  142.       Height          =   660
  143.       Index           =   2
  144.       Left            =   10440
  145.       Picture         =   "MAINFORM.frx":12A1E
  146.       ScaleHeight     =   600
  147.       ScaleWidth      =   945
  148.       TabIndex        =   79
  149.       Top             =   840
  150.       Width           =   1005
  151.    End
  152.    Begin VB.PictureBox Picture_B_Save 
  153.       AutoSize        =   -1  'True
  154.       Height          =   660
  155.       Index           =   1
  156.       Left            =   10200
  157.       Picture         =   "MAINFORM.frx":14860
  158.       ScaleHeight     =   600
  159.       ScaleWidth      =   945
  160.       TabIndex        =   78
  161.       Top             =   840
  162.       Width           =   1005
  163.    End
  164.    Begin VB.PictureBox PICTURE_B_LOAD 
  165.       AutoSize        =   -1  'True
  166.       Height          =   645
  167.       Index           =   3
  168.       Left            =   10680
  169.       Picture         =   "MAINFORM.frx":166A2
  170.       ScaleHeight     =   585
  171.       ScaleWidth      =   945
  172.       TabIndex        =   77
  173.       Top             =   240
  174.       Width           =   1005
  175.    End
  176.    Begin VB.PictureBox PICTURE_B_LOAD 
  177.       AutoSize        =   -1  'True
  178.       Height          =   645
  179.       Index           =   2
  180.       Left            =   10440
  181.       Picture         =   "MAINFORM.frx":18424
  182.       ScaleHeight     =   585
  183.       ScaleWidth      =   945
  184.       TabIndex        =   76
  185.       Top             =   240
  186.       Width           =   1005
  187.    End
  188.    Begin VB.PictureBox PICTURE_B_LOAD 
  189.       AutoSize        =   -1  'True
  190.       Height          =   660
  191.       Index           =   1
  192.       Left            =   10200
  193.       Picture         =   "MAINFORM.frx":1A1A6
  194.       ScaleHeight     =   600
  195.       ScaleWidth      =   945
  196.       TabIndex        =   75
  197.       Top             =   240
  198.       Width           =   1005
  199.    End
  200.    Begin VB.Frame Frame_SETUP 
  201.       Caption         =   "SETUP"
  202.       Height          =   2895
  203.       Left            =   480
  204.       TabIndex        =   21
  205.       Top             =   960
  206.       Visible         =   0   'False
  207.       Width           =   7935
  208.       Begin VB.CommandButton COMMAND_SETUP_OK 
  209.          Caption         =   "OK"
  210.          BeginProperty Font 
  211.             name            =   "MS Sans Serif"
  212.             charset         =   1
  213.             weight          =   700
  214.             size            =   13.5
  215.             underline       =   0   'False
  216.             italic          =   0   'False
  217.             strikethrough   =   0   'False
  218.          EndProperty
  219.          Height          =   375
  220.          Left            =   600
  221.          TabIndex        =   58
  222.          Top             =   1680
  223.          Width           =   975
  224.       End
  225.       Begin VB.ListBox LIST_SELECT 
  226.          Height          =   645
  227.          ItemData        =   "MAINFORM.frx":1BFE8
  228.          Left            =   120
  229.          List            =   "MAINFORM.frx":1BFF5
  230.          TabIndex        =   25
  231.          Top             =   720
  232.          Width           =   2055
  233.       End
  234.       Begin VB.Frame Frame_SU_Panel 
  235.          Caption         =   "Other Options"
  236.          ForeColor       =   &H00FF0000&
  237.          Height          =   975
  238.          Index           =   2
  239.          Left            =   2280
  240.          TabIndex        =   24
  241.          Top             =   120
  242.          Visible         =   0   'False
  243.          Width           =   4695
  244.          Begin VB.CheckBox Check_SaveSettingsOnOK 
  245.             Caption         =   "Save Settings on OK"
  246.             BeginProperty Font 
  247.                name            =   "MS Sans Serif"
  248.                charset         =   1
  249.                weight          =   400
  250.                size            =   12
  251.                underline       =   0   'False
  252.                italic          =   0   'False
  253.                strikethrough   =   0   'False
  254.             EndProperty
  255.             Height          =   300
  256.             Left            =   120
  257.             TabIndex        =   91
  258.             Top             =   600
  259.             Value           =   1  'Checked
  260.             Width           =   2775
  261.          End
  262.          Begin VB.CheckBox Check_ShowErrorDialogs 
  263.             Caption         =   "Display Error Dialogs"
  264.             BeginProperty Font 
  265.                name            =   "MS Sans Serif"
  266.                charset         =   1
  267.                weight          =   400
  268.                size            =   12
  269.                underline       =   0   'False
  270.                italic          =   0   'False
  271.                strikethrough   =   0   'False
  272.             EndProperty
  273.             Height          =   300
  274.             Left            =   120
  275.             TabIndex        =   90
  276.             Top             =   240
  277.             Width           =   2655
  278.          End
  279.       End
  280.       Begin VB.Frame Frame_SU_Panel 
  281.          Caption         =   "Image Save Options"
  282.          ForeColor       =   &H00FF0000&
  283.          Height          =   2535
  284.          Index           =   1
  285.          Left            =   2280
  286.          TabIndex        =   23
  287.          Top             =   120
  288.          Visible         =   0   'False
  289.          Width           =   5535
  290.          Begin VB.Frame Frame1 
  291.             Caption         =   "TIFF Compression"
  292.             Height          =   1335
  293.             Left            =   3480
  294.             TabIndex        =   53
  295.             Top             =   240
  296.             Width           =   1695
  297.             Begin VB.OptionButton Option_TIFF_Compression 
  298.                Caption         =   "Packbits"
  299.                Height          =   255
  300.                Index           =   3
  301.                Left            =   120
  302.                TabIndex        =   57
  303.                Top             =   960
  304.                Width           =   975
  305.             End
  306.             Begin VB.OptionButton Option_TIFF_Compression 
  307.                Caption         =   "LZW"
  308.                Height          =   255
  309.                Index           =   2
  310.                Left            =   120
  311.                TabIndex        =   56
  312.                Top             =   720
  313.                Width           =   735
  314.             End
  315.             Begin VB.OptionButton Option_TIFF_Compression 
  316.                Caption         =   "CCITT"
  317.                Height          =   255
  318.                Index           =   1
  319.                Left            =   120
  320.                TabIndex        =   55
  321.                Top             =   480
  322.                Width           =   855
  323.             End
  324.             Begin VB.OptionButton Option_TIFF_Compression 
  325.                Caption         =   "None"
  326.                Height          =   255
  327.                Index           =   0
  328.                Left            =   120
  329.                TabIndex        =   54
  330.                Top             =   240
  331.                Value           =   -1  'True
  332.                Width           =   735
  333.             End
  334.          End
  335.          Begin VB.CheckBox Check2 
  336.             Caption         =   "PNG Interlaced"
  337.             Height          =   255
  338.             Left            =   3480
  339.             TabIndex        =   51
  340.             Top             =   2040
  341.             Width           =   1415
  342.          End
  343.          Begin VB.VScrollBar VS_Smooth 
  344.             Height          =   375
  345.             Left            =   2760
  346.             Max             =   100
  347.             TabIndex        =   49
  348.             Top             =   2040
  349.             Value           =   100
  350.             Width           =   255
  351.          End
  352.          Begin VB.TextBox TB_Smooth 
  353.             Height          =   375
  354.             Left            =   2280
  355.             Locked          =   -1  'True
  356.             TabIndex        =   48
  357.             Top             =   2040
  358.             Width           =   495
  359.          End
  360.          Begin VB.VScrollBar VS_Quality 
  361.             Height          =   375
  362.             Left            =   1200
  363.             Max             =   100
  364.             TabIndex        =   45
  365.             Top             =   2040
  366.             Value           =   75
  367.             Width           =   255
  368.          End
  369.          Begin VB.TextBox TB_Quality 
  370.             Height          =   375
  371.             Left            =   720
  372.             Locked          =   -1  'True
  373.             TabIndex        =   44
  374.             Top             =   2040
  375.             Width           =   495
  376.          End
  377.          Begin VB.Frame Frame7 
  378.             Caption         =   "Resolution"
  379.             Height          =   1575
  380.             Left            =   120
  381.             TabIndex        =   38
  382.             Top             =   240
  383.             Width           =   3135
  384.             Begin VB.OptionButton OPTION_W_Resolution 
  385.                Caption         =   "24 Bit ( 16.7 Million Colors )"
  386.                Height          =   255
  387.                Index           =   4
  388.                Left            =   120
  389.                TabIndex        =   43
  390.                Top             =   1200
  391.                Width           =   2295
  392.             End
  393.             Begin VB.OptionButton OPTION_W_Resolution 
  394.                Caption         =   "8 Bit ( 256 Colors )"
  395.                Height          =   255
  396.                Index           =   3
  397.                Left            =   120
  398.                TabIndex        =   42
  399.                Top             =   960
  400.                Value           =   -1  'True
  401.                Width           =   2295
  402.             End
  403.             Begin VB.OptionButton OPTION_W_Resolution 
  404.                Caption         =   "4 Bit ( 16 Colors )"
  405.                Height          =   255
  406.                Index           =   2
  407.                Left            =   120
  408.                TabIndex        =   41
  409.                Top             =   720
  410.                Width           =   2295
  411.             End
  412.             Begin VB.OptionButton OPTION_W_Resolution 
  413.                Caption         =   "4 Bit ( 16 Colors Using VGA Palette )"
  414.                Height          =   255
  415.                Index           =   1
  416.                Left            =   120
  417.                TabIndex        =   40
  418.                Top             =   480
  419.                Width           =   2895
  420.             End
  421.             Begin VB.OptionButton OPTION_W_Resolution 
  422.                Caption         =   "1 Bit ( Monochrome )"
  423.                Height          =   255
  424.                Index           =   0
  425.                Left            =   120
  426.                TabIndex        =   39
  427.                Top             =   240
  428.                Width           =   2295
  429.             End
  430.          End
  431.          Begin VB.Line Line1 
  432.             BorderColor     =   &H00808080&
  433.             X1              =   3480
  434.             X2              =   5160
  435.             Y1              =   1800
  436.             Y2              =   1800
  437.          End
  438.          Begin VB.Label Label11 
  439.             Caption         =   "<- JPEG ->"
  440.             BeginProperty Font 
  441.                name            =   "MS Sans Serif"
  442.                charset         =   1
  443.                weight          =   400
  444.                size            =   8.25
  445.                underline       =   -1  'True
  446.                italic          =   0   'False
  447.                strikethrough   =   0   'False
  448.             EndProperty
  449.             Height          =   255
  450.             Left            =   1320
  451.             TabIndex        =   50
  452.             Top             =   1800
  453.             Width           =   855
  454.          End
  455.          Begin VB.Label Label13 
  456.             Caption         =   "Smooth"
  457.             Height          =   255
  458.             Left            =   1680
  459.             TabIndex        =   47
  460.             Top             =   2040
  461.             Width           =   615
  462.          End
  463.          Begin VB.Label Label12 
  464.             Caption         =   "Quality"
  465.             Height          =   255
  466.             Left            =   120
  467.             TabIndex        =   46
  468.             Top             =   2040
  469.             Width           =   615
  470.          End
  471.       End
  472.       Begin VB.Frame Frame_SU_Panel 
  473.          Caption         =   "Image Load Options"
  474.          ForeColor       =   &H00FF0000&
  475.          Height          =   2535
  476.          Index           =   0
  477.          Left            =   2280
  478.          TabIndex        =   22
  479.          Top             =   120
  480.          Width           =   5535
  481.          Begin VB.Frame Frame6 
  482.             Caption         =   "JPEG Scale"
  483.             Height          =   1215
  484.             Left            =   3480
  485.             TabIndex        =   28
  486.             Top             =   240
  487.             Width           =   1935
  488.             Begin VB.OptionButton OPTION_Scale 
  489.                Caption         =   "1/8 Size"
  490.                Height          =   195
  491.                Index           =   3
  492.                Left            =   120
  493.                TabIndex        =   37
  494.                Top             =   960
  495.                Width           =   975
  496.             End
  497.             Begin VB.OptionButton OPTION_Scale 
  498.                Caption         =   "1/4 Size"
  499.                Height          =   195
  500.                Index           =   2
  501.                Left            =   120
  502.                TabIndex        =   36
  503.                Top             =   720
  504.                Width           =   975
  505.             End
  506.             Begin VB.OptionButton OPTION_Scale 
  507.                Caption         =   "1/2 Size"
  508.                Height          =   195
  509.                Index           =   1
  510.                Left            =   120
  511.                TabIndex        =   35
  512.                Top             =   480
  513.                Width           =   975
  514.             End
  515.             Begin VB.OptionButton OPTION_Scale 
  516.                Caption         =   "1/1 Normal Size"
  517.                Height          =   195
  518.                Index           =   0
  519.                Left            =   120
  520.                TabIndex        =   34
  521.                Top             =   240
  522.                Value           =   -1  'True
  523.                Width           =   1455
  524.             End
  525.          End
  526.          Begin VB.Frame Frame5 
  527.             Caption         =   "Resolution"
  528.             Height          =   1935
  529.             Left            =   120
  530.             TabIndex        =   27
  531.             Top             =   240
  532.             Width           =   3255
  533.             Begin VB.CheckBox Check1 
  534.                Caption         =   "Dither"
  535.                Height          =   255
  536.                Left            =   120
  537.                TabIndex        =   52
  538.                Top             =   1560
  539.                Value           =   1  'Checked
  540.                Width           =   1415
  541.             End
  542.             Begin VB.OptionButton OPTION_R_Resolution 
  543.                Caption         =   "24 Bit ( 16.7 Million Colors)"
  544.                Height          =   255
  545.                Index           =   4
  546.                Left            =   120
  547.                TabIndex        =   33
  548.                Top             =   1200
  549.                Width           =   2175
  550.             End
  551.             Begin VB.OptionButton OPTION_R_Resolution 
  552.                Caption         =   "8 Bit ( 256 Colors )"
  553.                Height          =   255
  554.                Index           =   3
  555.                Left            =   120
  556.                TabIndex        =   32
  557.                Top             =   960
  558.                Value           =   -1  'True
  559.                Width           =   1695
  560.             End
  561.             Begin VB.OptionButton OPTION_R_Resolution 
  562.                Caption         =   "4 Bit ( 16 Colors )"
  563.                Height          =   255
  564.                Index           =   2
  565.                Left            =   120
  566.                TabIndex        =   31
  567.                Top             =   720
  568.                Width           =   1575
  569.             End
  570.             Begin VB.OptionButton OPTION_R_Resolution 
  571.                Caption         =   "4 Bit ( 16 Colors Using VGA Palette )"
  572.                Height          =   255
  573.                Index           =   1
  574.                Left            =   120
  575.                TabIndex        =   30
  576.                Top             =   480
  577.                Width           =   2895
  578.             End
  579.             Begin VB.OptionButton OPTION_R_Resolution 
  580.                Caption         =   "1 Bit ( Monochrome )"
  581.                Height          =   255
  582.                Index           =   0
  583.                Left            =   120
  584.                TabIndex        =   29
  585.                Top             =   240
  586.                Width           =   1935
  587.             End
  588.          End
  589.       End
  590.       Begin VB.Line Line2 
  591.          BorderColor     =   &H00404040&
  592.          BorderWidth     =   3
  593.          Index           =   3
  594.          X1              =   7920
  595.          X2              =   7920
  596.          Y1              =   0
  597.          Y2              =   2880
  598.       End
  599.       Begin VB.Line Line2 
  600.          BorderColor     =   &H00808080&
  601.          BorderWidth     =   3
  602.          Index           =   2
  603.          X1              =   0
  604.          X2              =   0
  605.          Y1              =   0
  606.          Y2              =   2880
  607.       End
  608.       Begin VB.Line Line2 
  609.          BorderColor     =   &H00808080&
  610.          BorderWidth     =   3
  611.          Index           =   1
  612.          X1              =   0
  613.          X2              =   7920
  614.          Y1              =   0
  615.          Y2              =   0
  616.       End
  617.       Begin VB.Line Line2 
  618.          BorderColor     =   &H00404040&
  619.          BorderWidth     =   3
  620.          Index           =   0
  621.          X1              =   0
  622.          X2              =   7920
  623.          Y1              =   2880
  624.          Y2              =   2880
  625.       End
  626.       Begin VB.Label Label14 
  627.          Caption         =   "Configure"
  628.          BeginProperty Font 
  629.             name            =   "MS Sans Serif"
  630.             charset         =   1
  631.             weight          =   700
  632.             size            =   13.5
  633.             underline       =   0   'False
  634.             italic          =   -1  'True
  635.             strikethrough   =   0   'False
  636.          EndProperty
  637.          Height          =   375
  638.          Left            =   120
  639.          TabIndex        =   26
  640.          Top             =   240
  641.          Width           =   1575
  642.       End
  643.    End
  644.    Begin VB.PictureBox Picture_B_Aquire 
  645.       AutoSize        =   -1  'True
  646.       Height          =   645
  647.       Index           =   0
  648.       Left            =   7680
  649.       Picture         =   "MAINFORM.frx":1C030
  650.       ScaleHeight     =   585
  651.       ScaleWidth      =   945
  652.       TabIndex        =   74
  653.       Top             =   2640
  654.       Width           =   1005
  655.    End
  656.    Begin VB.PictureBox Picture_B_Select 
  657.       AutoSize        =   -1  'True
  658.       Height          =   645
  659.       Index           =   0
  660.       Left            =   7680
  661.       Picture         =   "MAINFORM.frx":1DDB2
  662.       ScaleHeight     =   585
  663.       ScaleWidth      =   945
  664.       TabIndex        =   73
  665.       Top             =   2040
  666.       Width           =   1005
  667.    End
  668.    Begin VB.PictureBox Picture_B_Setup 
  669.       AutoSize        =   -1  'True
  670.       Height          =   645
  671.       Index           =   0
  672.       Left            =   7680
  673.       Picture         =   "MAINFORM.frx":1FB34
  674.       ScaleHeight     =   585
  675.       ScaleWidth      =   945
  676.       TabIndex        =   72
  677.       Top             =   1440
  678.       Width           =   1005
  679.    End
  680.    Begin VB.PictureBox Picture_B_Save 
  681.       AutoSize        =   -1  'True
  682.       Height          =   660
  683.       Index           =   0
  684.       Left            =   7680
  685.       Picture         =   "MAINFORM.frx":218B6
  686.       ScaleHeight     =   600
  687.       ScaleWidth      =   945
  688.       TabIndex        =   71
  689.       Top             =   840
  690.       Width           =   1005
  691.    End
  692.    Begin VB.PictureBox PICTURE_B_LOAD 
  693.       AutoSize        =   -1  'True
  694.       Height          =   660
  695.       Index           =   0
  696.       Left            =   7680
  697.       Picture         =   "MAINFORM.frx":236F8
  698.       ScaleHeight     =   600
  699.       ScaleWidth      =   945
  700.       TabIndex        =   70
  701.       Top             =   240
  702.       Width           =   1005
  703.    End
  704.    Begin VB.Frame Frame2 
  705.       Caption         =   "Image"
  706.       Height          =   3375
  707.       Left            =   6000
  708.       TabIndex        =   59
  709.       Top             =   120
  710.       Width           =   1575
  711.       Begin VB.TextBox TEXT_II 
  712.          BackColor       =   &H00800000&
  713.          Enabled         =   0   'False
  714.          ForeColor       =   &H00FFFFFF&
  715.          Height          =   285
  716.          Index           =   4
  717.          Left            =   240
  718.          TabIndex        =   69
  719.          Top             =   2880
  720.          Width           =   1095
  721.       End
  722.       Begin VB.TextBox TEXT_II 
  723.          BackColor       =   &H00800000&
  724.          Enabled         =   0   'False
  725.          ForeColor       =   &H00FFFFFF&
  726.          Height          =   285
  727.          Index           =   3
  728.          Left            =   240
  729.          TabIndex        =   67
  730.          Top             =   2280
  731.          Width           =   1095
  732.       End
  733.       Begin VB.TextBox TEXT_II 
  734.          BackColor       =   &H00800000&
  735.          Enabled         =   0   'False
  736.          ForeColor       =   &H00FFFFFF&
  737.          Height          =   285
  738.          Index           =   2
  739.          Left            =   240
  740.          TabIndex        =   65
  741.          Top             =   1680
  742.          Width           =   1095
  743.       End
  744.       Begin VB.TextBox TEXT_II 
  745.          BackColor       =   &H00800000&
  746.          Enabled         =   0   'False
  747.          ForeColor       =   &H00FFFFFF&
  748.          Height          =   285
  749.          Index           =   1
  750.          Left            =   240
  751.          TabIndex        =   63
  752.          Top             =   1080
  753.          Width           =   1095
  754.       End
  755.       Begin VB.TextBox TEXT_II 
  756.          BackColor       =   &H00800000&
  757.          Enabled         =   0   'False
  758.          ForeColor       =   &H00FFFFFF&
  759.          Height          =   285
  760.          Index           =   0
  761.          Left            =   240
  762.          TabIndex        =   61
  763.          Top             =   480
  764.          Width           =   1095
  765.       End
  766.       Begin VB.Label Label19 
  767.          Caption         =   "Number Of Colors:"
  768.          BeginProperty Font 
  769.             name            =   "MS Sans Serif"
  770.             charset         =   1
  771.             weight          =   400
  772.             size            =   8.25
  773.             underline       =   -1  'True
  774.             italic          =   0   'False
  775.             strikethrough   =   0   'False
  776.          EndProperty
  777.          Height          =   255
  778.          Left            =   120
  779.          TabIndex        =   68
  780.          Top             =   2640
  781.          Width           =   1335
  782.       End
  783.       Begin VB.Label Label18 
  784.          Caption         =   "Planes:"
  785.          BeginProperty Font 
  786.             name            =   "MS Sans Serif"
  787.             charset         =   1
  788.             weight          =   400
  789.             size            =   8.25
  790.             underline       =   -1  'True
  791.             italic          =   0   'False
  792.             strikethrough   =   0   'False
  793.          EndProperty
  794.          Height          =   255
  795.          Left            =   120
  796.          TabIndex        =   66
  797.          Top             =   2040
  798.          Width           =   615
  799.       End
  800.       Begin VB.Label Label17 
  801.          Caption         =   "Bits Per Pixel:"
  802.          BeginProperty Font 
  803.             name            =   "MS Sans Serif"
  804.             charset         =   1
  805.             weight          =   400
  806.             size            =   8.25
  807.             underline       =   -1  'True
  808.             italic          =   0   'False
  809.             strikethrough   =   0   'False
  810.          EndProperty
  811.          Height          =   255
  812.          Left            =   120
  813.          TabIndex        =   64
  814.          Top             =   1440
  815.          Width           =   1095
  816.       End
  817.       Begin VB.Label Label16 
  818.          Caption         =   "Height:"
  819.          BeginProperty Font 
  820.             name            =   "MS Sans Serif"
  821.             charset         =   1
  822.             weight          =   400
  823.             size            =   8.25
  824.             underline       =   -1  'True
  825.             italic          =   0   'False
  826.             strikethrough   =   0   'False
  827.          EndProperty
  828.          Height          =   255
  829.          Left            =   120
  830.          TabIndex        =   62
  831.          Top             =   840
  832.          Width           =   735
  833.       End
  834.       Begin VB.Label Label15 
  835.          Caption         =   "Width:"
  836.          BeginProperty Font 
  837.             name            =   "MS Sans Serif"
  838.             charset         =   1
  839.             weight          =   400
  840.             size            =   8.25
  841.             underline       =   -1  'True
  842.             italic          =   0   'False
  843.             strikethrough   =   0   'False
  844.          EndProperty
  845.          Height          =   255
  846.          Left            =   120
  847.          TabIndex        =   60
  848.          Top             =   240
  849.          Width           =   615
  850.       End
  851.    End
  852.    Begin VB.Timer Timer1 
  853.       Enabled         =   0   'False
  854.       Interval        =   100
  855.       Left            =   9000
  856.       Top             =   3480
  857.    End
  858.    Begin VB.Frame Frame_Opts 
  859.       Height          =   255
  860.       Left            =   0
  861.       TabIndex        =   15
  862.       Top             =   0
  863.       Width           =   6015
  864.       Begin VB.OptionButton OptShow 
  865.          Caption         =   "Fit To Window"
  866.          Height          =   255
  867.          Index           =   3
  868.          Left            =   4560
  869.          TabIndex        =   20
  870.          Top             =   0
  871.          Width           =   1455
  872.       End
  873.       Begin VB.OptionButton OptShow 
  874.          Caption         =   "Only to enlarge"
  875.          Height          =   255
  876.          Index           =   2
  877.          Left            =   3120
  878.          TabIndex        =   19
  879.          Top             =   0
  880.          Width           =   1455
  881.       End
  882.       Begin VB.OptionButton OptShow 
  883.          Caption         =   "Only to shrink"
  884.          Height          =   255
  885.          Index           =   1
  886.          Left            =   1800
  887.          TabIndex        =   18
  888.          Top             =   0
  889.          Width           =   1335
  890.       End
  891.       Begin VB.OptionButton OptShow 
  892.          Caption         =   "None"
  893.          Height          =   255
  894.          Index           =   0
  895.          Left            =   1080
  896.          TabIndex        =   17
  897.          Top             =   0
  898.          Value           =   -1  'True
  899.          Width           =   975
  900.       End
  901.       Begin VB.Label Label10 
  902.          Caption         =   "Size Mode:"
  903.          Height          =   255
  904.          Left            =   0
  905.          TabIndex        =   16
  906.          Top             =   0
  907.          Width           =   1095
  908.       End
  909.    End
  910.    Begin VB.VScrollBar VS_Image 
  911.       Height          =   5055
  912.       Left            =   5640
  913.       TabIndex        =   14
  914.       Top             =   240
  915.       Visible         =   0   'False
  916.       Width           =   255
  917.    End
  918.    Begin VB.HScrollBar HS_Image 
  919.       Height          =   255
  920.       Left            =   120
  921.       TabIndex        =   13
  922.       Top             =   5280
  923.       Visible         =   0   'False
  924.       Width           =   5535
  925.    End
  926.    Begin VB.CommandButton cmdExit 
  927.       Caption         =   "E&xit"
  928.       Height          =   375
  929.       Left            =   7800
  930.       TabIndex        =   1
  931.       Top             =   5700
  932.       Width           =   735
  933.    End
  934.    Begin VB.Frame Frame4 
  935.       Height          =   590
  936.       Left            =   120
  937.       TabIndex        =   10
  938.       Top             =   5550
  939.       Width           =   8535
  940.       Begin VB.Label Label9 
  941.          Caption         =   "Technical Support: Kevin Adams, 74742.1444@CompuServe.Com"
  942.          Height          =   375
  943.          Left            =   3360
  944.          TabIndex        =   12
  945.          Top             =   130
  946.          Width           =   2415
  947.       End
  948.       Begin VB.Label Label8 
  949.          Caption         =   "Technical Support: Jan Dekkers 72130.353@CompuServe.Com"
  950.          Height          =   375
  951.          Left            =   120
  952.          TabIndex        =   11
  953.          Top             =   130
  954.          Width           =   2295
  955.       End
  956.    End
  957.    Begin VB.Frame Frame3 
  958.       ClipControls    =   0   'False
  959.       Height          =   2055
  960.       Left            =   5925
  961.       TabIndex        =   2
  962.       Top             =   3480
  963.       Width           =   2775
  964.       Begin VB.Label Label7 
  965.          Alignment       =   2  'Center
  966.          BackColor       =   &H00C0C0C0&
  967.          Caption         =   "ImageLib is royalty free"
  968.          BeginProperty Font 
  969.             name            =   "Arial"
  970.             charset         =   1
  971.             weight          =   700
  972.             size            =   9
  973.             underline       =   0   'False
  974.             italic          =   0   'False
  975.             strikethrough   =   0   'False
  976.          EndProperty
  977.          ForeColor       =   &H00808000&
  978.          Height          =   225
  979.          Left            =   120
  980.          TabIndex        =   9
  981.          Top             =   1800
  982.          Width           =   2535
  983.       End
  984.       Begin VB.Label Label6 
  985.          Alignment       =   2  'Center
  986.          Caption         =   "(818) 766-3900"
  987.          Height          =   255
  988.          Left            =   180
  989.          TabIndex        =   8
  990.          Top             =   1560
  991.          Width           =   2415
  992.       End
  993.       Begin VB.Label Label5 
  994.          Alignment       =   2  'Center
  995.          Caption         =   "1-800  404-3832"
  996.          BeginProperty Font 
  997.             name            =   "MS Sans Serif"
  998.             charset         =   1
  999.             weight          =   400
  1000.             size            =   13.5
  1001.             underline       =   0   'False
  1002.             italic          =   0   'False
  1003.             strikethrough   =   0   'False
  1004.          EndProperty
  1005.          ForeColor       =   &H00000000&
  1006.          Height          =   375
  1007.          Left            =   240
  1008.          TabIndex        =   7
  1009.          Top             =   1180
  1010.          Width           =   2295
  1011.       End
  1012.       Begin VB.Label Label4 
  1013.          Alignment       =   2  'Center
  1014.          Caption         =   "To order call"
  1015.          Height          =   255
  1016.          Left            =   120
  1017.          TabIndex        =   6
  1018.          Top             =   960
  1019.          Width           =   2415
  1020.       End
  1021.       Begin VB.Label Label3 
  1022.          Alignment       =   2  'Center
  1023.          Caption         =   "Copyright by SkyLine Tools 1995"
  1024.          Height          =   255
  1025.          Left            =   180
  1026.          TabIndex        =   5
  1027.          Top             =   720
  1028.          Width           =   2415
  1029.       End
  1030.       Begin VB.Label Label2 
  1031.          Alignment       =   2  'Center
  1032.          Caption         =   "16 Bit Version"
  1033.          Height          =   255
  1034.          Left            =   840
  1035.          TabIndex        =   4
  1036.          Top             =   480
  1037.          Width           =   1095
  1038.       End
  1039.       Begin VB.Label Label1 
  1040.          Alignment       =   2  'Center
  1041.          Caption         =   "ImageLib 3.0 Professional Edition"
  1042.          Height          =   255
  1043.          Left            =   160
  1044.          TabIndex        =   3
  1045.          Top             =   240
  1046.          Width           =   2415
  1047.       End
  1048.    End
  1049.    Begin VB.PictureBox Picture1 
  1050.       BeginProperty Font 
  1051.          name            =   "MS Sans Serif"
  1052.          charset         =   1
  1053.          weight          =   700
  1054.          size            =   8.25
  1055.          underline       =   0   'False
  1056.          italic          =   0   'False
  1057.          strikethrough   =   0   'False
  1058.       EndProperty
  1059.       Height          =   5295
  1060.       Left            =   120
  1061.       MouseIcon       =   "MAINFORM.frx":2553A
  1062.       ScaleHeight     =   5235
  1063.       ScaleWidth      =   5715
  1064.       TabIndex        =   0
  1065.       Top             =   240
  1066.       Width           =   5775
  1067.    End
  1068.    Begin VB.Shape Shape1 
  1069.       Height          =   495
  1070.       Left            =   3720
  1071.       Top             =   2880
  1072.       Width           =   1215
  1073.    End
  1074.    Begin MSComDlg.CommonDialog CMDialog1 
  1075.       Left            =   120
  1076.       Top             =   120
  1077.       _version        =   65536
  1078.       _extentx        =   847
  1079.       _extenty        =   847
  1080.       _stockprops     =   0
  1081.    End
  1082. Attribute VB_Name = "MainForm"
  1083. Attribute VB_Creatable = False
  1084. Attribute VB_Exposed = False
  1085. Dim r As Integer
  1086. Dim hdib As Integer
  1087. Dim hddb As Integer
  1088. Dim hpal As Integer
  1089. Dim BMINFO As BITMAP
  1090. Dim Filename As String
  1091. Dim ReadResolution As Integer
  1092. Dim ReadScale As Integer
  1093. Dim WriteResolution As Integer
  1094. Dim bPNGInterlaced As Integer
  1095. Dim Compression As Long
  1096. Dim ReadDither As Integer
  1097. Dim JpegSaveQuality As Integer
  1098. Dim JpegSaveSmooth As Integer
  1099. Dim DisplayOption As Integer
  1100. Dim TiffStripSize As Integer
  1101. Dim ConfigData As ConfigRecord
  1102. Dim DevBPP As Integer
  1103. Dim hTempDC As Integer
  1104. Dim RDR As RedrawRecord
  1105. ' Start-up Picture Control Info
  1106. Dim P_ctl_X%
  1107. Dim P_ctl_Y%
  1108. Dim P_ctl_width%
  1109. Dim P_ctl_height%
  1110. Dim I_X%
  1111. Dim I_Y%
  1112. Dim I_Width%
  1113. Dim I_Height%
  1114. Dim I_Resize_Method%
  1115. Dim bDebug%
  1116. Dim Form_Caption$
  1117. Function FileExists(F$) As Integer
  1118.     CF% = FreeFile
  1119.     On Error GoTo FileError
  1120.     Open F$ For Input As CF%
  1121.     Close CF%
  1122.     FileExists = True
  1123.     Exit Function
  1124. FileError:
  1125.     On Error GoTo 0
  1126.     FileExists = False
  1127. End Function
  1128. Function LoadConfig() As Integer
  1129.     NA$ = App.Path + "\" + App.EXEName + ".CFG"
  1130.     If Not FileExists(NA$) Then
  1131.         LoadConfig = False
  1132.         Exit Function
  1133.     End If
  1134.     SF% = FreeFile
  1135.     Open NA$ For Binary As SF% Len = Len(ConfigData)
  1136.         Get #SF%, , ConfigData
  1137.     Close SF%
  1138.     LoadConfig = True
  1139.     ReadResolution = ConfigData.ReadResolution
  1140.     ReadScale = ConfigData.ReadScale
  1141.     WriteResolution = ConfigData.WriteResolution
  1142.     bPNGInterlaced = ConfigData.bPNGInterlaced
  1143.     Compression = ConfigData.Compression
  1144.     ReadDither = ConfigData.ReadDither
  1145.     JpegSaveQuality = ConfigData.JpegSaveQuality
  1146.     JpegSaveSmooth = ConfigData.JpegSaveSmooth
  1147.     I_Resize_Method% = ConfigData.DisplayOption
  1148.     bDebug% = ConfigData.bDebug
  1149. End Function
  1150. Sub EnableButton_Aquire(bEnable As Integer)
  1151.     If bEnable Then
  1152.         P% = 1
  1153.     Else
  1154.         P% = 3
  1155.     End If
  1156.     Picture_B_Aquire(0).Picture = Picture_B_Aquire(P%).Picture
  1157.     Picture_B_Aquire(0).Enabled = bEnable
  1158. End Sub
  1159. Function DrawDIB(bInit%) As Integer
  1160.     Dim iOldBMP As Integer
  1161.     Dim iOldPAL As Integer
  1162.     Pixel_W% = Picture1.ScaleX(P_ctl_width, Picture1.ScaleMode, 3)
  1163.     Pixel_H% = Picture1.ScaleY(P_ctl_height, Picture1.ScaleMode, 3)
  1164.     I_Width% = Pixel_W%
  1165.     I_Height% = Pixel_H%
  1166.     bNormal% = False
  1167.     If hddb = 0 Then Exit Function
  1168.     If bInit% Then
  1169.         I_X% = 0
  1170.         I_Y% = 0
  1171.         HS_Image.Visible = False
  1172.         VS_Image.Visible = False
  1173.         Picture1.Height = P_ctl_height%
  1174.         Picture1.Width = P_ctl_width%
  1175.         
  1176.         Select Case (I_Resize_Method%)
  1177.             Case 0: ' Normal
  1178.                 bNormal% = True
  1179.             Case 1, 2: ' To Shrink/Enlarge
  1180.                 I_Denom% = BMINFO.bmWidth ' Use Largest For Ratio
  1181.                 If BMINFO.bmHeight > I_Denom% Then I_Denom% = BMINFO.bmHeight
  1182.                 
  1183.                 P_Denom% = Pixel_W% ' Use Perfect Square
  1184.                 If Pixel_H% < P_Denom% Then P_Denom% = Pixel_H%
  1185.                  
  1186.                 If (I_Resize_Method% = 1 And I_Denom% > P_Denom%) Or (I_Resize_Method = 2 And I_Denom% < P_Denom%) Then
  1187.                     I_Width% = P_Denom% * (BMINFO.bmWidth / I_Denom%)
  1188.                     I_Height% = P_Denom% * (BMINFO.bmHeight / I_Denom%)
  1189.                     bNormal% = False
  1190.                 Else
  1191.                     bNormal% = True
  1192.                 End If
  1193.                 
  1194.         End Select
  1195.     Else
  1196.         I_Denom% = BMINFO.bmWidth ' Use Largest For Ratio
  1197.         If BMINFO.bmHeight > I_Denom% Then I_Denom% = BMINFO.bmHeight
  1198.                 
  1199.         P_Denom% = Pixel_W% ' Use Perfect Square
  1200.         If Pixel_H% < P_Denom% Then P_Denom% = Pixel_H%
  1201.         If (I_Resize_Method% = 1 And I_Denom% > P_Denom%) Or (I_Resize_Method% = 2 And I_Denom% < P_Denom%) Then
  1202.             bNormal% = False
  1203.         Else
  1204.             bNormal% = True
  1205.         End If
  1206.     End If
  1207.        
  1208.     'hTempBMP = CreateDiscardableBitmap(Picture1.hdc, Pixel_W%, Pixel_H%) 'new
  1209.     'iOldPictureBMP% = SelectObject(Picture1.hdc, hTempBMP) ' Select BITMAP Into Picture1
  1210.     Picture1.Cls
  1211.     iOldBMP = SelectObject(hTempDC, hddb)
  1212.     If bInit% And bNormal% Then
  1213.                 If BMINFO.bmWidth > Pixel_W% Then
  1214.                     'SetupHS
  1215.                     Picture1.Height = P_ctl_height% - HS_Image.Height
  1216.                     HS_Image.Max = BMINFO.bmWidth - Pixel_W%
  1217.                     LC% = HS_Image.Max / 5: If LC% < 1 Then LC% = 1
  1218.                     HS_Image.LargeChange = LC%
  1219.                     HS_Image.value = 0
  1220.                     HS_Image.Visible = True
  1221.                 Else
  1222.                     HS_Image.Visible = False
  1223.                     Picture1.Height = P_ctl_height%
  1224.                 End If
  1225.                 If BMINFO.bmHeight > Pixel_H% Then
  1226.                     'SetupVS
  1227.                     Picture1.Width = P_ctl_width% - VS_Image.Width
  1228.                     VS_Image.Max = BMINFO.bmHeight - Pixel_H%
  1229.                     LC% = VS_Image.Max / 5: If LC% < 1 Then LC% = 1
  1230.                     VS_Image.LargeChange = LC%
  1231.                     VS_Image.value = 0
  1232.                     VS_Image.Visible = True
  1233.                 Else
  1234.                     VS_Image.Visible = False
  1235.                     Picture1.Width = P_ctl_width%
  1236.                 End If
  1237.         End If
  1238.     X = SetStretchBltMode(Picture1.hdc, 3)
  1239.     If bNormal% Then
  1240.         X = BitBlt(Picture1.hdc, -I_X%, -I_Y%, Pixel_W% + I_X%, Pixel_H% + I_Y%, hTempDC, 0, 0, SRCCOPY)
  1241.         RDR.X = -I_X%: RDR.Y = -I_Y%: RDR.W = Pixel_W% + I_X%: RDR.H = Pixel_H% + I_Y%
  1242.     Else
  1243.         X = StretchBlt(Picture1.hdc, 0, 0, I_Width%, I_Height%, hTempDC, 0, 0, BMINFO.bmWidth, BMINFO.bmHeight, SRCCOPY)
  1244.         RDR.X = I_Width%: RDR.Y = I_Height%: RDR.W = BMINFO.bmWidth: RDR.H = BMINFO.bmHeight
  1245.     End If
  1246.     RDR.bNormal = bNormal%
  1247.     SetPalette
  1248. End Function
  1249. Sub EnableButton_Select(bEnable As Integer)
  1250.     If bEnable Then
  1251.         P% = 1
  1252.     Else
  1253.         P% = 3
  1254.     End If
  1255.     Picture_B_Select(0).Picture = Picture_B_Select(P%).Picture
  1256.     Picture_B_Select(0).Enabled = bEnable
  1257. End Sub
  1258. Function GetFilterString(IType$, F%) As String
  1259.    IType$ = LCase$(IType$)
  1260.    Ftr$ = ""
  1261.    Select Case (IType$)
  1262.         Case "jpg": Ftr$ = "JPEG (*.jpg)|*.jpg": F% = 0
  1263.         Case "gif": Ftr$ = "GIF (*.gif)|*.gif": F% = 1
  1264.         Case "pcx": Ftr$ = "PCX (*.pcx)|*.pcx": F% = 2
  1265.         Case "bmp": Ftr$ = "BMP (*.bmp)|*.bmp": F% = 3
  1266.         Case "png": Ftr$ = "PNG (*.png)|*.png": F% = 4
  1267.         Case "tif": Ftr$ = "TIF (*.tif)|*.tif": F% = 5
  1268.         Case Default:
  1269.                     Ftr$ = "Images (*.jpg;*.gif;*.pcx;*.bmp;*.png;*.tif)|*.jpg;*.gif;*.pcx;*.bmp;*.png;*.tif|JPEG (*.jpg)|*.jpg|GIF (*.gif)|*.gif|PCX (*.pcx)|*.pcx|BMP (*.bmp)|*.bmp|PNG (*.png)|*.png|TIF (*.tif)|*.tif": F% = -1
  1270.         End Select
  1271.    GetFilterString = Ftr$
  1272. End Function
  1273. Function GetImageInfo()
  1274.     lbe = GetObjectGDI(hddb, Len(BMINFO), BMINFO)
  1275.     Select Case (ReadResolution)
  1276.         Case 1: BITSPIX = 2: C$ = "2"
  1277.         Case 0: BITSPIX = 4: C$ = "16"
  1278.         Case 4: BITSPIX = 4: C$ = "16"
  1279.         Case 8: BITSPIX = 8: C$ = "256"
  1280.         Case 24: BITSPIX = 24: C$ = "16.7M"
  1281.         Case Default:
  1282.             BITSPIX = Asc(BMINFO.bmBitsPixel)
  1283.     End Select
  1284.     X$ = "File: " & Filename$ & ", Width: " & BMINFO.bmWidth & ", Height: " & BMINFO.bmHeight & ", WidthBytes: " & BMINFO.bmWidthBytes & ", Planes: " & Asc(BMINFO.bmPlanes) & ", BitsPixel: " & BITSPIX
  1285.     TEXT_II(0).Text = Str$(BMINFO.bmWidth)
  1286.     TEXT_II(1).Text = Str$(BMINFO.bmHeight)
  1287.     TEXT_II(2).Text = Str$(BITSPIX)
  1288.     TEXT_II(3).Text = Str$(Asc(BMINFO.bmPlanes))
  1289.     TEXT_II(4).Text = C$
  1290. End Function
  1291. Function LoadImage(IType$) As Integer
  1292.    Dim Oldhdib As Integer
  1293.    Dim Oldhddb As Integer
  1294.    Dim Oldhpal As Integer
  1295.    Static ftype As String * 10
  1296.    Static fcompression As String * 10
  1297.    ValidRes$ = Chr$(1) + Chr$(4) + Chr$(8) + Chr$(24)
  1298.    LoadImage = False
  1299.    Ftr$ = GetFilterString$(IType$, F%)
  1300.    CMDialog1.Filename = ""
  1301.    CMDialog1.flags = &H1000&
  1302.    CMDialog1.Filter = Ftr$
  1303.    CMDialog1.Action = 1
  1304.    If CMDialog1.Filename <> "" Then
  1305.       Screen.MousePointer = 11
  1306.       Oldhdib = hdib: hdib = 0
  1307.       Oldhddb = hddb: hddb = 0
  1308.       Oldhpal = hpal: hpal = 0
  1309.             
  1310.       Filename$ = CMDialog1.Filename
  1311.       
  1312.       ' Abort Function if intended file is invalid
  1313.       P% = InStr(Filename$, ".")
  1314.       If P% And P% < Len(Filename$) Then
  1315.           EXT$ = Mid$(Filename$, P% + 1)
  1316.           Ftr$ = GetFilterString$(EXT$, F%)
  1317.       Else
  1318.           Exit Function
  1319.       End If
  1320.       
  1321.       'X = fileinfo(Filename$, ftype, fWidth%, fHeight%, fbitspixel%, fPlanes%, fNumColors%, fcompression, 0)
  1322.       RR% = ReadResolution
  1323.       RRC% = RR%
  1324.       If RRC% = 0 Then RRC% = 4
  1325.       
  1326.       ' Use a valid Resolution <= Device Depth
  1327.       ResPos% = InStr(ValidRes$, Chr$(RRC%))
  1328.       If RRC% > DevBPP And (DevBPP < 16) Then
  1329.         RR% = Asc(Mid$(ValidRes$, ResPos% - 1))
  1330.       End If
  1331.             
  1332.       Select Case (F%)
  1333.         Case 0:
  1334.             r = readjpgfile(CMDialog1.Filename, RR%, ReadScale, ReadDither, hddb, hpal, 0, bDebug%)
  1335.         Case 1:
  1336.             r = readgiffile(CMDialog1.Filename, RR%, ReadDither, hddb, hpal, 0, bDebug%)
  1337.         Case 2:
  1338.             r = readpcxfile(CMDialog1.Filename, RR%, ReadDither, hddb, hpal, 0, bDebug%)
  1339.         Case 3:
  1340.             r = readbmpfile(CMDialog1.Filename, RR%, ReadDither, hddb, hpal, 0, bDebug%)
  1341.         Case 4:
  1342.             r = readpngfile(CMDialog1.Filename, RR%, ReadDither, hddb, hpal, 0, bDebug%)
  1343.         Case 5:
  1344.             r = readtiffile(CMDialog1.Filename, RR%, ReadDither, hddb, hpal, 0, bDebug%)
  1345.       End Select
  1346.       
  1347.       If r > 0 Then
  1348.         'lbe = GetObjectGDI(hddb, Len(BMINFO), BMINFO)
  1349.         'X$ = "File: " & Filename$ & ", Width: " & BMINFO.bmWidth & ", Height: " & BMINFO.bmHeight & ", WidthBytes: " & BMINFO.bmWidthBytes & ", Planes: " & Asc(BMINFO.bmPlanes) & ", BitsPixel: " & Asc(BMINFO.bmBitsPixel)
  1350.         'SetScrollyText X$
  1351.         X = GetImageInfo()
  1352.         'XX% = fileinfo(Filename$, FileType$, fWidth%, fHeight%, fbitspixel%, fPlanes%, fColors%, fCompression$, bDebug%)
  1353.         'Free Replaced Resources
  1354.         If (hddb <> Oldhddb) And Oldhddb Then DeleteObject (Oldhddb)
  1355.         If (hdib <> Oldhdib) And Oldhdib Then DeleteObject (Oldhdib)
  1356.         If (hpal <> Oldhpal) And Oldhpal Then DeleteObject (Oldhpal)
  1357.         X = SelectPalette(hTempDC, hpal, False)
  1358.         SetPalette
  1359.       Else
  1360.         'Load Failed Restore Previous GDI Handles
  1361.         hddb = Oldhddb
  1362.         hdib = Oldhdib
  1363.         hpal = Oldhpal
  1364.         Exit Function
  1365.       End If
  1366.       Screen.MousePointer = 0
  1367.       
  1368.       LoadImage = True
  1369.       Filename$ = CMDialog1.Filename
  1370.       P% = InStr(Filename$, ".")
  1371.       If P% = 0 Then
  1372.         Form.Caption = Form_Caption$ + " - (NoName)"
  1373.         Exit Function
  1374.       Else
  1375.         For I% = P% To 1 Step -1
  1376.             If InStr(":\", Mid$(Filename$, I%, 1)) Then Exit For
  1377.         Next I%
  1378.       End If
  1379.       MainForm.Caption = Form_Caption$ + " - " + Mid$(Filename$, I% + 1)
  1380.       End If
  1381. End Function
  1382. Function Redraw()
  1383. If hddb = 0 Then Exit Function
  1384. X = SetStretchBltMode(Picture1.hdc, 3)
  1385. If RDR.bNormal Then
  1386.         X = BitBlt(Picture1.hdc, RDR.X, RDR.Y, RDR.W, RDR.H, hTempDC, 0, 0, SRCCOPY)
  1387.         X = StretchBlt(Picture1.hdc, 0, 0, RDR.X, RDR.Y, hTempDC, 0, 0, RDR.W, RDR.H, SRCCOPY)
  1388. End If
  1389. SetPalette
  1390. End Function
  1391. Function SaveImage(IType$) As Integer
  1392.    EMsg$ = "File Not Saved!, Please specify a valid file type."
  1393.    Ftr$ = GetFilterString$(IType$, F%)
  1394.    CMDialog1.Filename = ""
  1395.    CMDialog1.flags = &H1000&
  1396.    CMDialog1.Filter = Ftr$
  1397.    CMDialog1.Action = 2
  1398.    If CMDialog1.Filename <> "" Then
  1399.       Screen.MousePointer = 11
  1400.            
  1401.       Filename$ = CMDialog1.Filename
  1402.       
  1403.       ' Abort Function if intended file is invalid
  1404.       P% = InStr(Filename$, ".")
  1405.       If P% And P% < Len(Filename$) Then
  1406.           EXT$ = Mid$(Filename$, P% + 1)
  1407.           Ftr$ = GetFilterString$(EXT$, F%)
  1408.           If F% = -1 Then
  1409.             Screen.MousePointer = 0
  1410.             MsgBox EMsg$
  1411.             Exit Function
  1412.           End If
  1413.       Else
  1414.           If IType$ <> "" Then
  1415.             Filename$ = Filename$ + "." + IType$
  1416.           Else
  1417.             Screen.MousePointer = 0
  1418.             MsgBox EMsg$
  1419.             Exit Function
  1420.           End If
  1421.       End If
  1422.             
  1423.       Select Case (F%)
  1424.         Case 0:
  1425.             r = writejpgfile(Filename$, JpegSaveQuality, JpegSaveSmooth, 24, hddb, hpal, 0, bDebug%)
  1426.         Case 1:
  1427.             r = writegiffile(Filename$, WriteResolution, hddb, hpal, 0, bDebug%)
  1428.         Case 2:
  1429.             r = writepcxfile(Filename$, WriteResolution, hddb, hpal, 0, bDebug%)
  1430.         Case 3:
  1431.             r = writebmpfile(Filename$, WriteResolution, hddb, hpal, 0, bDebug%)
  1432.         Case 4:
  1433.             r = writepngfile(Filename$, WriteResolution, bPNGInterlaced, hddb, hpal, 0, bDebug%)
  1434.         Case 5:
  1435.             r = writetiffile(Filename$, Compression, TiffStripSize, WriteResolution, hddb, hpal, 0, bDebug%)
  1436.       End Select
  1437.       
  1438.       Screen.MousePointer = 0
  1439.       
  1440.       If r Then
  1441.          SaveImage = True
  1442.       Else
  1443.          SaveImage = False
  1444.          Exit Function
  1445.       End If
  1446.    End If
  1447. End Function
  1448. Function SaveConfig() As Integer
  1449.     NA$ = App.Path + "\" + App.EXEName + ".CFG"
  1450.     ConfigData.ReadResolution = ReadResolution
  1451.     ConfigData.ReadScale = ReadScale
  1452.     ConfigData.WriteResolution = WriteResolution
  1453.     ConfigData.bPNGInterlaced = bPNGInterlaced
  1454.     ConfigData.Compression = Compression
  1455.     ConfigData.ReadDither = ReadDither
  1456.     ConfigData.JpegSaveQuality = JpegSaveQuality
  1457.     ConfigData.JpegSaveSmooth = JpegSaveSmooth
  1458.     ConfigData.DisplayOption = I_Resize_Method%
  1459.     ConfigData.bDebug = bDebug%
  1460.     On Error GoTo FileError
  1461.     SF% = FreeFile
  1462.     Open NA$ For Binary As SF% Len = Len(ConfigData)
  1463.         Put #SF%, , ConfigData
  1464.     Close SF%
  1465.     SaveConfig = 1
  1466.     Exit Function
  1467. FileError:
  1468.     On Error GoTo 0
  1469.     SaveConfig = 0
  1470. End Function
  1471. Sub SetPalette()
  1472.     iOldPAL = SelectPalette(Picture1.hdc, hpal, False)
  1473.     X = RealizePalette(Picture1.hdc)
  1474. End Sub
  1475. Sub ShowDisplayOptions(bShow%)
  1476.     'Frame_Opts.top = Frame3.top
  1477.     'Frame_Opts.left = Frame3.left
  1478.     'Frame_Opts.Visible = bShow%
  1479.     TB_Quality.Text = Str$(100 - VS_Quality.value)
  1480.     TB_Smooth.Text = Str$(100 - VS_Smooth.value)
  1481. End Sub
  1482. Sub UpdateControls()
  1483.     For I% = 0 To 4
  1484.         OPTION_W_Resolution(I%).value = False
  1485.         OPTION_R_Resolution(I%).value = False
  1486.     Next I%
  1487.     For I% = 0 To 3
  1488.         OptShow(I%).value = False
  1489.         OPTION_Scale(I%).value = False
  1490.         Option_TIFF_Compression(I%).value = False
  1491.     Next I%
  1492.     VS_Quality.value = 100 - JpegSaveQuality
  1493.     VS_Smooth.value = 100 - JpegSaveSmooth
  1494.     TB_Quality.Text = Str$(JpegSaveQuality)
  1495.     TB_Smooth.Text = Str$(JpegSaveSmooth)
  1496.     Check2.value = bPNGInterlaced
  1497.     Check1.value = ReadDither
  1498.     Check_ShowErrorDialogs.value = bDebug%
  1499. Select Case (WriteResolution)
  1500.     Case 1: OPTION_W_Resolution(0).value = True
  1501.     Case 0: OPTION_W_Resolution(1).value = True
  1502.     Case 4: OPTION_W_Resolution(2).value = True
  1503.     Case 8: OPTION_W_Resolution(3).value = True
  1504.     Case 24: OPTION_W_Resolution(4).value = True
  1505. End Select
  1506. Select Case (ReadResolution)
  1507.     Case 1: OPTION_R_Resolution(0).value = True
  1508.     Case 0: OPTION_R_Resolution(1).value = True
  1509.     Case 4: OPTION_R_Resolution(2).value = True
  1510.     Case 8: OPTION_R_Resolution(3).value = True
  1511.     Case 24: OPTION_R_Resolution(4).value = True
  1512. End Select
  1513. Select Case (Compression)
  1514.     Case 1: Option_TIFF_Compression(0).value = True
  1515.     Case 2: Option_TIFF_Compression(1).value = True
  1516.     Case 5: Option_TIFF_Compression(2).value = True
  1517.     Case 32773: Option_TIFF_Compression(3).value = True
  1518. End Select
  1519. Select Case (ReadScale)
  1520.     Case 1: OPTION_Scale(0).value = True
  1521.     Case 2: OPTION_Scale(1).value = True
  1522.     Case 4: OPTION_Scale(2).value = True
  1523.     Case 8: OPTION_Scale(3).value = True
  1524. End Select
  1525. If I_Resize_Method% < 0 Or I_Resize_Method% > 3 Then
  1526.     I_Resize_Method% = 0
  1527. End If
  1528. OptShow(I_Resize_Method%).value = True
  1529. End Sub
  1530. Private Sub Check_ShowErrorDialogs_Click()
  1531.       bDebug% = Check_ShowErrorDialogs.value
  1532. End Sub
  1533. Private Sub Check1_Click()
  1534.     If Check1.value = 1 Then ReadDither = 1 Else ReadDither = 0
  1535. End Sub
  1536. Private Sub Check2_Click()
  1537.     If Check2.value = 1 Then PNGInterlaced = 1 Else PNGInterlaced = 0
  1538. End Sub
  1539. Private Sub CMD_OPT_OK_Click()
  1540. End Sub
  1541. Private Sub cmdExit_Click()
  1542.    End
  1543. End Sub
  1544. Private Sub Command1_Click()
  1545. End Sub
  1546. Private Sub COMMAND_SETUP_OK_Click()
  1547.     Frame_SETUP.Visible = False
  1548.     PICTURE_B_LOAD(0).Enabled = True
  1549.     Picture_B_Save(0).Enabled = True
  1550.     Picture_B_Setup(0).Enabled = True
  1551.     JpegSaveQuality = Val(TB_Quality.Text)
  1552.     JpegSaveSmooth = Val(TB_Smooth.Text)
  1553.     If Check_SaveSettingsOnOK.value = 1 Then
  1554.         X = SaveConfig()
  1555.     End If
  1556. End Sub
  1557. Private Sub Form_Activate()
  1558.     X = Redraw()
  1559. End Sub
  1560. Private Sub Form_Load()
  1561.     DevBPP = GetDeviceCaps(hdc, BITSPIXEL)
  1562.     ReadResolution = 8
  1563.     WriteResolution = 8
  1564.     PNGInterlaced = 0
  1565.     ReadDither = 1
  1566.     JpegSaveQuality = 75    '0 to 100 (poor to good)
  1567.     JpegSaveSmooth = 10     '0 to 100 (none to full)
  1568.     Compression = 1
  1569.     TiffStripSize = 5
  1570.     P_ctl_width% = Picture1.Width
  1571.     P_ctl_height% = Picture1.Height
  1572.     P_ctl_X% = Picture1.left
  1573.     P_ctl_Y% = Picture1.top
  1574.     bDebug% = 0
  1575.     X = twainavailable(hWnd, 0)
  1576.     EnableButton_Select (X = 1)
  1577.     EnableButton_Aquire (X = 1)
  1578.     hTempDC = CreateCompatibleDC(Picture1.hdc)
  1579.     X = LoadConfig()
  1580.     UpdateControls
  1581.     Form_Caption$ = "ImageLib 3.1 Example"
  1582. End Sub
  1583. Private Sub Form_Paint()
  1584.     X = Redraw()
  1585.     Timer1.Enabled = True
  1586. End Sub
  1587. Private Sub Form_Terminate()
  1588.         If (hddb) Then DeleteObject (hddb)
  1589.         If (hdib) Then DeleteObject (hdib)
  1590.         If (hpal) Then DeleteObject (hpal)
  1591.         X = DeleteDC(hTempDC)
  1592. End Sub
  1593. Private Sub Frame2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1594.     ShowDisplayOptions True
  1595. End Sub
  1596. Private Sub HS_Image_Change()
  1597.     I_X% = HS_Image.value
  1598.     X = DrawDIB(False)
  1599.     Timer1.Enabled = True
  1600. End Sub
  1601. Private Sub LIST_SELECT_Click()
  1602.   For I% = 0 To 2
  1603.         Frame_SU_Panel(I%).Visible = (LIST_SELECT.ListIndex = I%)
  1604.     Next I%
  1605. End Sub
  1606. Private Sub OPTION_R_Resolution_Click(Index As Integer)
  1607.     Select Case (Index)
  1608.         Case 0: ReadResolution = 1
  1609.         Case 1: ReadResolution = 0
  1610.         Case 2: ReadResolution = 4
  1611.         Case 3: ReadResolution = 8
  1612.         Case 4: ReadResolution = 24
  1613.     End Select
  1614. End Sub
  1615. Private Sub OPTION_Scale_Click(Index As Integer)
  1616.     Select Case (Index)
  1617.         Case 0: ReadScale = 1
  1618.         Case 1: ReadScale = 2
  1619.         Case 2: ReadScale = 4
  1620.         Case 3: ReadScale = 8
  1621.     End Select
  1622. End Sub
  1623. Private Sub Option_TIFF_Compression_Click(Index As Integer)
  1624.     Select Case (Index)
  1625.         Case 0: Compression = 1
  1626.         Case 1: Compression = 2
  1627.         Case 2: Compression = 5
  1628.         Case 3: Compression = 32773
  1629.     End Select
  1630. End Sub
  1631. Private Sub OPTION_W_Resolution_Click(Index As Integer)
  1632.    Select Case (Index)
  1633.         Case 0: WriteResolution = 1
  1634.         Case 1: WriteResolution = 0
  1635.         Case 2: WriteResolution = 4
  1636.         Case 3: WriteResolution = 8
  1637.         Case 4: WriteResolution = 24
  1638.     End Select
  1639. End Sub
  1640. Private Sub OptShow_Click(Index As Integer)
  1641.     I_Resize_Method% = Index
  1642.     X = DrawDIB(True)
  1643.     Timer1.Enabled = True
  1644. End Sub
  1645. Private Sub Picture_B_Aquire_Click(Index As Integer)
  1646.    newhddb% = 0: newhpal% = 0: HideUI% = 0
  1647.     r = aquireimage(hWnd, ReadResolution, ReadDither, HideUI%, newhddb%, newhpal%, 0, bDebug%)
  1648.      If (newhddb% <> 0) And hddb Then
  1649.         DeleteObject (hddb)
  1650.         hddb = newhddb%
  1651.      End If
  1652.      If (newhpal% <> 0) And hpal Then
  1653.         DeleteObject (hpal)
  1654.         hddb = newhpal%
  1655.         X = DrawDIB(True)
  1656.         Picture1_Click
  1657.         Timer1.Enabled = True
  1658.      End If
  1659.      Filename$ = ""
  1660.      
  1661. End Sub
  1662. Private Sub Picture_B_Aquire_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  1663.     Picture_B_Aquire(0).Picture = Picture_B_Aquire(2).Picture
  1664. End Sub
  1665. Private Sub Picture_B_Aquire_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  1666.     Picture_B_Aquire(0).Picture = Picture_B_Aquire(1).Picture
  1667.     Timer1.Enabled = True
  1668. End Sub
  1669. Private Sub PICTURE_B_LOAD_Click(Index As Integer)
  1670.       bLoadedOk% = LoadImage("")
  1671.       If bLoadedOk% Then
  1672.         X = DrawDIB(True)
  1673.         Picture1_Click
  1674.         Timer1.Enabled = True
  1675.       End If
  1676. End Sub
  1677. Private Sub PICTURE_B_LOAD_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  1678.     PICTURE_B_LOAD(0).Picture = PICTURE_B_LOAD(2).Picture
  1679. End Sub
  1680. Private Sub PICTURE_B_LOAD_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  1681.     PICTURE_B_LOAD(0).Picture = PICTURE_B_LOAD(1).Picture
  1682.     Timer1.Enabled = True
  1683. End Sub
  1684. Private Sub Picture_B_Save_Click(Index As Integer)
  1685.    SaveImage ("")
  1686.    Picture1_Click
  1687.    Timer1.Enabled = True
  1688. End Sub
  1689. Private Sub Picture_B_Save_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  1690.     Picture_B_Save(0).Picture = Picture_B_Save(2).Picture
  1691. End Sub
  1692. Private Sub Picture_B_Save_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  1693.     Picture_B_Save(0).Picture = Picture_B_Save(1).Picture
  1694.     Timer1.Enabled = True
  1695. End Sub
  1696. Private Sub Picture_B_Select_Click(Index As Integer)
  1697.     X = selectsource(hWnd, bDebug%)
  1698.     Timer1.Enabled = True
  1699. End Sub
  1700. Private Sub Picture_B_Select_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  1701.         Picture_B_Select(0).Picture = Picture_B_Select(2).Picture
  1702. End Sub
  1703. Private Sub Picture_B_Select_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  1704.     Picture_B_Select(0).Picture = Picture_B_Select(1).Picture
  1705.     Timer1.Enabled = True
  1706. End Sub
  1707. Private Sub Picture_B_Setup_Click(Index As Integer)
  1708.     Frame_SETUP.Visible = True
  1709.     PICTURE_B_LOAD(0).Enabled = False
  1710.     Picture_B_Save(0).Enabled = False
  1711.     Picture_B_Setup(0).Enabled = False
  1712.     UpdateControls
  1713.     Picture1_Click
  1714.     Timer1.Enabled = True
  1715. End Sub
  1716. Private Sub Picture_B_Setup_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  1717.     Picture_B_Setup(0).Picture = Picture_B_Setup(2).Picture
  1718. End Sub
  1719. Private Sub Picture_B_Setup_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  1720.     Picture_B_Setup(0).Picture = Picture_B_Setup(1).Picture
  1721.     Timer1.Enabled = True
  1722. End Sub
  1723. Private Sub Picture1_Click()
  1724.     X = Redraw()
  1725. End Sub
  1726. Private Sub Picture1_GotFocus()
  1727.     X = Redraw()
  1728. End Sub
  1729. Private Sub Picture1_LostFocus()
  1730.     SetPalette
  1731. End Sub
  1732. Private Sub Picture1_Paint()
  1733.     Picture1_Click
  1734. End Sub
  1735. Private Sub Picture2_Click()
  1736. End Sub
  1737. Private Sub Timer1_Timer()
  1738.     Picture1_Click
  1739.     Timer1.Enabled = False
  1740. End Sub
  1741. Private Sub VS_Image_Change()
  1742.     I_Y% = VS_Image.value
  1743.     X = DrawDIB(False)
  1744.     Timer1.Enabled = True
  1745. End Sub
  1746. Private Sub VS_Quality_Change()
  1747.      TB_Quality.Text = Str$(100 - VS_Quality.value)
  1748. End Sub
  1749. Private Sub VS_Smooth_Change()
  1750.     TB_Smooth.Text = Str$(100 - VS_Smooth.value)
  1751. End Sub
  1752.