home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Print_and_210872462008.psc / frmEdit.frm < prev    next >
Text File  |  2008-04-05  |  29KB  |  954 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form frmEdit 
  4.    BackColor       =   &H00E0E0E0&
  5.    Caption         =   "                                      Picture Editor"
  6.    ClientHeight    =   7170
  7.    ClientLeft      =   60
  8.    ClientTop       =   450
  9.    ClientWidth     =   6390
  10.    ControlBox      =   0   'False
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   7170
  13.    ScaleWidth      =   6390
  14.    StartUpPosition =   2  'CenterScreen
  15.    Begin VB.CommandButton cmdExpand 
  16.       Caption         =   "Expand"
  17.       Height          =   435
  18.       Left            =   4530
  19.       TabIndex        =   59
  20.       Top             =   6105
  21.       Width           =   1740
  22.    End
  23.    Begin VB.CommandButton cmdExit 
  24.       Caption         =   "Cancel"
  25.       Height          =   525
  26.       Left            =   4530
  27.       TabIndex        =   56
  28.       Top             =   6585
  29.       Width           =   1740
  30.    End
  31.    Begin VB.CommandButton cmdOkay 
  32.       Caption         =   "Okay"
  33.       Height          =   525
  34.       Left            =   2160
  35.       TabIndex        =   55
  36.       Top             =   6585
  37.       Width           =   2145
  38.    End
  39.    Begin VB.CommandButton cmdResetRGT 
  40.       Caption         =   "Reset"
  41.       Height          =   285
  42.       Left            =   9030
  43.       TabIndex        =   54
  44.       Top             =   5760
  45.       Width           =   900
  46.    End
  47.    Begin VB.CommandButton cmdResetWB 
  48.       Caption         =   "Reset"
  49.       Height          =   270
  50.       Left            =   6930
  51.       TabIndex        =   53
  52.       Top             =   5745
  53.       Width           =   1215
  54.    End
  55.    Begin VB.CommandButton cmdResetMid 
  56.       Caption         =   "Reset"
  57.       Height          =   315
  58.       Left            =   3795
  59.       TabIndex        =   52
  60.       Top             =   5745
  61.       Width           =   2025
  62.    End
  63.    Begin VB.CommandButton cmdResetLeft 
  64.       Caption         =   "Reset"
  65.       Height          =   315
  66.       Left            =   360
  67.       TabIndex        =   51
  68.       Top             =   5745
  69.       Width           =   1875
  70.    End
  71.    Begin VB.CommandButton cmdOpenPix 
  72.       Caption         =   "Open Picture"
  73.       Height          =   540
  74.       Left            =   105
  75.       TabIndex        =   40
  76.       Top             =   6570
  77.       Width           =   1875
  78.    End
  79.    Begin MSComDlg.CommonDialog cde 
  80.       Left            =   5625
  81.       Top             =   7320
  82.       _ExtentX        =   847
  83.       _ExtentY        =   847
  84.       _Version        =   393216
  85.    End
  86.    Begin VB.OptionButton Option1 
  87.       BackColor       =   &H00E0E0E0&
  88.       Caption         =   "Cool white lamp or Fluorescent"
  89.       Height          =   255
  90.       Index           =   16
  91.       Left            =   7620
  92.       TabIndex        =   39
  93.       Top             =   2760
  94.       Width           =   2535
  95.    End
  96.    Begin VB.OptionButton Option1 
  97.       BackColor       =   &H00E0E0E0&
  98.       Caption         =   "Northern daylight"
  99.       Height          =   255
  100.       Index           =   15
  101.       Left            =   7620
  102.       TabIndex        =   38
  103.       Top             =   2400
  104.       Width           =   2535
  105.    End
  106.    Begin VB.OptionButton Option1 
  107.       BackColor       =   &H00E0E0E0&
  108.       Caption         =   "Bond paper print"
  109.       Height          =   255
  110.       Index           =   14
  111.       Left            =   7620
  112.       TabIndex        =   37
  113.       Top             =   2040
  114.       Width           =   2535
  115.    End
  116.    Begin VB.OptionButton Option1 
  117.       BackColor       =   &H00E0E0E0&
  118.       Caption         =   "Normal print"
  119.       Height          =   255
  120.       Index           =   13
  121.       Left            =   7620
  122.       TabIndex        =   36
  123.       Top             =   1680
  124.       Width           =   2535
  125.    End
  126.    Begin VB.OptionButton Option1 
  127.       BackColor       =   &H00E0E0E0&
  128.       Caption         =   "NTSC daylight"
  129.       Height          =   195
  130.       Index           =   12
  131.       Left            =   7620
  132.       TabIndex        =   35
  133.       Top             =   1380
  134.       Width           =   2535
  135.    End
  136.    Begin VB.OptionButton Option1 
  137.       BackColor       =   &H00E0E0E0&
  138.       Caption         =   "Noon sunlight"
  139.       Height          =   255
  140.       Index           =   11
  141.       Left            =   7620
  142.       TabIndex        =   34
  143.       Top             =   1020
  144.       Width           =   2535
  145.    End
  146.    Begin VB.OptionButton Option1 
  147.       BackColor       =   &H00E0E0E0&
  148.       Caption         =   "Tungsten lamp"
  149.       Height          =   255
  150.       Index           =   10
  151.       Left            =   7620
  152.       TabIndex        =   33
  153.       Top             =   660
  154.       Width           =   2475
  155.    End
  156.    Begin VB.OptionButton Option1 
  157.       BackColor       =   &H00E0E0E0&
  158.       Caption         =   "Default Illuminant"
  159.       Height          =   315
  160.       Index           =   9
  161.       Left            =   7620
  162.       TabIndex        =   32
  163.       Top             =   240
  164.       Value           =   -1  'True
  165.       Width           =   2535
  166.    End
  167.    Begin VB.TextBox Text1 
  168.       Appearance      =   0  'Flat
  169.       Height          =   255
  170.       Index           =   8
  171.       Left            =   7680
  172.       TabIndex        =   29
  173.       Text            =   "0"
  174.       Top             =   5400
  175.       Width           =   555
  176.    End
  177.    Begin VB.TextBox Text1 
  178.       Appearance      =   0  'Flat
  179.       Height          =   255
  180.       Index           =   7
  181.       Left            =   6780
  182.       TabIndex        =   28
  183.       Text            =   "10000"
  184.       Top             =   5400
  185.       Width           =   555
  186.    End
  187.    Begin VB.TextBox Text1 
  188.       Appearance      =   0  'Flat
  189.       Height          =   255
  190.       Index           =   6
  191.       Left            =   1860
  192.       TabIndex        =   27
  193.       Text            =   "0"
  194.       Top             =   5400
  195.       Width           =   555
  196.    End
  197.    Begin VB.TextBox Text1 
  198.       Appearance      =   0  'Flat
  199.       Height          =   255
  200.       Index           =   5
  201.       Left            =   9180
  202.       TabIndex        =   26
  203.       Text            =   "0"
  204.       Top             =   5400
  205.       Width           =   555
  206.    End
  207.    Begin VB.TextBox Text1 
  208.       Appearance      =   0  'Flat
  209.       Height          =   255
  210.       Index           =   4
  211.       Left            =   1020
  212.       TabIndex        =   25
  213.       Text            =   "0"
  214.       Top             =   5400
  215.       Width           =   555
  216.    End
  217.    Begin VB.TextBox Text1 
  218.       Appearance      =   0  'Flat
  219.       Height          =   255
  220.       Index           =   3
  221.       Left            =   5400
  222.       TabIndex        =   24
  223.       Text            =   "10000"
  224.       Top             =   5400
  225.       Width           =   555
  226.    End
  227.    Begin VB.TextBox Text1 
  228.       Appearance      =   0  'Flat
  229.       Height          =   255
  230.       Index           =   2
  231.       Left            =   4320
  232.       TabIndex        =   23
  233.       Text            =   "10000"
  234.       Top             =   5400
  235.       Width           =   555
  236.    End
  237.    Begin VB.TextBox Text1 
  238.       Appearance      =   0  'Flat
  239.       Height          =   255
  240.       Index           =   1
  241.       Left            =   3180
  242.       TabIndex        =   22
  243.       Text            =   "10000"
  244.       Top             =   5400
  245.       Width           =   555
  246.    End
  247.    Begin VB.VScrollBar vs 
  248.       Height          =   1695
  249.       Index           =   8
  250.       LargeChange     =   100
  251.       Left            =   7800
  252.       Max             =   4000
  253.       TabIndex        =   20
  254.       Top             =   3600
  255.       Width           =   315
  256.    End
  257.    Begin VB.VScrollBar vs 
  258.       Height          =   1695
  259.       Index           =   7
  260.       LargeChange     =   100
  261.       Left            =   6900
  262.       Max             =   10000
  263.       Min             =   6000
  264.       TabIndex        =   18
  265.       Top             =   3600
  266.       Value           =   10000
  267.       Width           =   315
  268.    End
  269.    Begin VB.VScrollBar vs 
  270.       Height          =   1695
  271.       Index           =   6
  272.       LargeChange     =   10
  273.       Left            =   1980
  274.       Max             =   100
  275.       Min             =   -100
  276.       TabIndex        =   16
  277.       Top             =   3600
  278.       Width           =   315
  279.    End
  280.    Begin VB.VScrollBar vs 
  281.       Height          =   1695
  282.       Index           =   5
  283.       Left            =   9300
  284.       Max             =   100
  285.       Min             =   -100
  286.       TabIndex        =   14
  287.       Top             =   3600
  288.       Width           =   315
  289.    End
  290.    Begin VB.VScrollBar vs 
  291.       Height          =   1695
  292.       Index           =   4
  293.       LargeChange     =   10
  294.       Left            =   1140
  295.       Max             =   100
  296.       Min             =   -100
  297.       TabIndex        =   12
  298.       Top             =   3600
  299.       Width           =   315
  300.    End
  301.    Begin VB.VScrollBar vs 
  302.       Height          =   1695
  303.       Index           =   3
  304.       LargeChange     =   500
  305.       Left            =   5520
  306.       Max             =   30000
  307.       Min             =   2500
  308.       TabIndex        =   9
  309.       Top             =   3600
  310.       Value           =   10000
  311.       Width           =   315
  312.    End
  313.    Begin VB.VScrollBar vs 
  314.       Height          =   1695
  315.       Index           =   2
  316.       LargeChange     =   500
  317.       Left            =   4440
  318.       Max             =   30000
  319.       Min             =   2500
  320.       TabIndex        =   8
  321.       Top             =   3600
  322.       Value           =   10000
  323.       Width           =   315
  324.    End
  325.    Begin VB.VScrollBar vs 
  326.       Height          =   1695
  327.       Index           =   1
  328.       LargeChange     =   500
  329.       Left            =   3300
  330.       Max             =   30000
  331.       Min             =   2500
  332.       TabIndex        =   5
  333.       Top             =   3600
  334.       Value           =   10000
  335.       Width           =   315
  336.    End
  337.    Begin VB.CheckBox Check1 
  338.       BackColor       =   &H00E0E0E0&
  339.       Caption         =   "Negative"
  340.       Height          =   255
  341.       Left            =   6915
  342.       TabIndex        =   4
  343.       Top             =   6180
  344.       Width           =   1035
  345.    End
  346.    Begin VB.TextBox Text1 
  347.       Appearance      =   0  'Flat
  348.       Height          =   255
  349.       Index           =   0
  350.       Left            =   120
  351.       TabIndex        =   3
  352.       Text            =   "0"
  353.       Top             =   5400
  354.       Width           =   555
  355.    End
  356.    Begin VB.VScrollBar vs 
  357.       Height          =   1695
  358.       Index           =   0
  359.       LargeChange     =   10
  360.       Left            =   240
  361.       Max             =   100
  362.       Min             =   -100
  363.       TabIndex        =   2
  364.       Top             =   3600
  365.       Width           =   315
  366.    End
  367.    Begin VB.PictureBox Picture2 
  368.       BackColor       =   &H00FFFFFF&
  369.       Height          =   2055
  370.       Left            =   3270
  371.       ScaleHeight     =   133
  372.       ScaleMode       =   3  'Pixel
  373.       ScaleWidth      =   192
  374.       TabIndex        =   1
  375.       Top             =   465
  376.       Width           =   2940
  377.    End
  378.    Begin VB.PictureBox Picture1 
  379.       AutoRedraw      =   -1  'True
  380.       BackColor       =   &H00FFFFFF&
  381.       Height          =   2055
  382.       Left            =   105
  383.       ScaleHeight     =   1995
  384.       ScaleWidth      =   2880
  385.       TabIndex        =   0
  386.       Top             =   465
  387.       Width           =   2940
  388.    End
  389.    Begin VB.Label Label25 
  390.       BackStyle       =   0  'Transparent
  391.       Caption         =   "Modified"
  392.       BeginProperty Font 
  393.          Name            =   "MS Sans Serif"
  394.          Size            =   13.5
  395.          Charset         =   0
  396.          Weight          =   700
  397.          Underline       =   0   'False
  398.          Italic          =   0   'False
  399.          Strikethrough   =   0   'False
  400.       EndProperty
  401.       Height          =   285
  402.       Left            =   4125
  403.       TabIndex        =   61
  404.       Top             =   105
  405.       Width           =   1290
  406.    End
  407.    Begin VB.Label Label24 
  408.       BackStyle       =   0  'Transparent
  409.       Caption         =   "Original"
  410.       BeginProperty Font 
  411.          Name            =   "MS Sans Serif"
  412.          Size            =   13.5
  413.          Charset         =   0
  414.          Weight          =   700
  415.          Underline       =   0   'False
  416.          Italic          =   0   'False
  417.          Strikethrough   =   0   'False
  418.       EndProperty
  419.       Height          =   405
  420.       Left            =   1005
  421.       TabIndex        =   60
  422.       Top             =   75
  423.       Width           =   1200
  424.    End
  425.    Begin VB.Label Label13 
  426.       BackStyle       =   0  'Transparent
  427.       Caption         =   "Note:"
  428.       BeginProperty Font 
  429.          Name            =   "MS Sans Serif"
  430.          Size            =   8.25
  431.          Charset         =   0
  432.          Weight          =   700
  433.          Underline       =   0   'False
  434.          Italic          =   0   'False
  435.          Strikethrough   =   0   'False
  436.       EndProperty
  437.       Height          =   240
  438.       Left            =   1590
  439.       TabIndex        =   58
  440.       Top             =   2595
  441.       Width           =   510
  442.    End
  443.    Begin VB.Label Label12 
  444.       BackStyle       =   0  'Transparent
  445.       Caption         =   "           Some clipping may occur on final print-out. This does not affect the original picture."
  446.       Height          =   585
  447.       Left            =   1575
  448.       TabIndex        =   57
  449.       Top             =   2595
  450.       Width           =   3135
  451.    End
  452.    Begin VB.Image Image1 
  453.       Height          =   1755
  454.       Left            =   5580
  455.       Stretch         =   -1  'True
  456.       Top             =   7770
  457.       Width           =   2730
  458.    End
  459.    Begin VB.Label Label15 
  460.       AutoSize        =   -1  'True
  461.       BackStyle       =   0  'Transparent
  462.       Caption         =   "+"
  463.       Height          =   195
  464.       Left            =   2340
  465.       TabIndex        =   50
  466.       Top             =   4740
  467.       Width           =   90
  468.    End
  469.    Begin VB.Label Label14 
  470.       BackStyle       =   0  'Transparent
  471.       Caption         =   "-"
  472.       BeginProperty Font 
  473.          Name            =   "MS Sans Serif"
  474.          Size            =   12
  475.          Charset         =   0
  476.          Weight          =   400
  477.          Underline       =   0   'False
  478.          Italic          =   0   'False
  479.          Strikethrough   =   0   'False
  480.       EndProperty
  481.       Height          =   255
  482.       Left            =   2340
  483.       TabIndex        =   49
  484.       Top             =   3900
  485.       Width           =   135
  486.    End
  487.    Begin VB.Label Label23 
  488.       BackStyle       =   0  'Transparent
  489.       Caption         =   "100 %"
  490.       Height          =   315
  491.       Left            =   7320
  492.       TabIndex        =   48
  493.       Top             =   4860
  494.       Width           =   495
  495.    End
  496.    Begin VB.Label Label22 
  497.       BackStyle       =   0  'Transparent
  498.       Caption         =   "0 %"
  499.       Height          =   315
  500.       Left            =   8160
  501.       TabIndex        =   47
  502.       Top             =   3840
  503.       Width           =   315
  504.    End
  505.    Begin VB.Label Label21 
  506.       BackStyle       =   0  'Transparent
  507.       Caption         =   "100 %"
  508.       Height          =   315
  509.       Left            =   7200
  510.       TabIndex        =   46
  511.       Top             =   3780
  512.       Width           =   495
  513.    End
  514.    Begin VB.Label Label20 
  515.       BackStyle       =   0  'Transparent
  516.       Caption         =   "0 %"
  517.       Height          =   315
  518.       Left            =   6600
  519.       TabIndex        =   45
  520.       Top             =   4860
  521.       Width           =   315
  522.    End
  523.    Begin VB.Label Label19 
  524.       AutoSize        =   -1  'True
  525.       BackStyle       =   0  'Transparent
  526.       Caption         =   "+"
  527.       Height          =   195
  528.       Left            =   600
  529.       TabIndex        =   44
  530.       Top             =   4740
  531.       Width           =   90
  532.    End
  533.    Begin VB.Label Label18 
  534.       BackStyle       =   0  'Transparent
  535.       Caption         =   "-"
  536.       BeginProperty Font 
  537.          Name            =   "MS Sans Serif"
  538.          Size            =   12
  539.          Charset         =   0
  540.          Weight          =   400
  541.          Underline       =   0   'False
  542.          Italic          =   0   'False
  543.          Strikethrough   =   0   'False
  544.       EndProperty
  545.       Height          =   255
  546.       Left            =   600
  547.       TabIndex        =   43
  548.       Top             =   3900
  549.       Width           =   135
  550.    End
  551.    Begin VB.Label Label17 
  552.       AutoSize        =   -1  'True
  553.       BackStyle       =   0  'Transparent
  554.       Caption         =   "+"
  555.       Height          =   195
  556.       Left            =   1500
  557.       TabIndex        =   42
  558.       Top             =   4740
  559.       Width           =   90
  560.    End
  561.    Begin VB.Label Label16 
  562.       BackStyle       =   0  'Transparent
  563.       Caption         =   "-"
  564.       BeginProperty Font 
  565.          Name            =   "MS Sans Serif"
  566.          Size            =   12
  567.          Charset         =   0
  568.          Weight          =   400
  569.          Underline       =   0   'False
  570.          Italic          =   0   'False
  571.          Strikethrough   =   0   'False
  572.       EndProperty
  573.       Height          =   255
  574.       Left            =   1500
  575.       TabIndex        =   41
  576.       Top             =   3900
  577.       Width           =   135
  578.    End
  579.    Begin VB.Shape Shape5 
  580.       Height          =   3015
  581.       Left            =   7500
  582.       Top             =   120
  583.       Width           =   2715
  584.    End
  585.    Begin VB.Label Label11 
  586.       BackStyle       =   0  'Transparent
  587.       Caption         =   "Green"
  588.       Height          =   255
  589.       Left            =   8820
  590.       TabIndex        =   31
  591.       Top             =   4740
  592.       Width           =   435
  593.    End
  594.    Begin VB.Label Label10 
  595.       BackStyle       =   0  'Transparent
  596.       Caption         =   "Red"
  597.       Height          =   255
  598.       Left            =   9720
  599.       TabIndex        =   30
  600.       Top             =   3960
  601.       Width           =   375
  602.    End
  603.    Begin VB.Shape Shape4 
  604.       Height          =   2475
  605.       Left            =   8760
  606.       Top             =   3240
  607.       Width           =   1455
  608.    End
  609.    Begin VB.Shape Shape3 
  610.       Height          =   2475
  611.       Left            =   6540
  612.       Top             =   3240
  613.       Width           =   1935
  614.    End
  615.    Begin VB.Shape Shape2 
  616.       Height          =   2475
  617.       Left            =   2940
  618.       Top             =   3240
  619.       Width           =   3315
  620.    End
  621.    Begin VB.Shape Shape1 
  622.       Height          =   2475
  623.       Left            =   60
  624.       Top             =   3240
  625.       Width           =   2595
  626.    End
  627.    Begin VB.Label Label9 
  628.       BackStyle       =   0  'Transparent
  629.       Caption         =   "To Black"
  630.       Height          =   255
  631.       Left            =   7620
  632.       TabIndex        =   21
  633.       Top             =   3360
  634.       Width           =   915
  635.    End
  636.    Begin VB.Label Label8 
  637.       BackStyle       =   0  'Transparent
  638.       Caption         =   "To White"
  639.       Height          =   255
  640.       Left            =   6660
  641.       TabIndex        =   19
  642.       Top             =   3360
  643.       Width           =   915
  644.    End
  645.    Begin VB.Label Label7 
  646.       BackStyle       =   0  'Transparent
  647.       Caption         =   "Color"
  648.       Height          =   255
  649.       Left            =   1980
  650.       TabIndex        =   17
  651.       Top             =   3360
  652.       Width           =   435
  653.    End
  654.    Begin VB.Label Label6 
  655.       BackStyle       =   0  'Transparent
  656.       Caption         =   "Red/Green Tint"
  657.       Height          =   255
  658.       Left            =   8940
  659.       TabIndex        =   15
  660.       Top             =   3300
  661.       Width           =   1275
  662.    End
  663.    Begin VB.Label Label5 
  664.       BackStyle       =   0  'Transparent
  665.       Caption         =   "Brightness"
  666.       Height          =   255
  667.       Left            =   960
  668.       TabIndex        =   13
  669.       Top             =   3360
  670.       Width           =   795
  671.    End
  672.    Begin VB.Label Label4 
  673.       BackStyle       =   0  'Transparent
  674.       Caption         =   "Blue Gamma "
  675.       Height          =   255
  676.       Left            =   5280
  677.       TabIndex        =   11
  678.       Top             =   3360
  679.       Width           =   1095
  680.    End
  681.    Begin VB.Label Label3 
  682.       BackStyle       =   0  'Transparent
  683.       Caption         =   "Green Gamma "
  684.       Height          =   255
  685.       Left            =   4020
  686.       TabIndex        =   10
  687.       Top             =   3360
  688.       Width           =   1095
  689.    End
  690.    Begin VB.Label Label2 
  691.       BackStyle       =   0  'Transparent
  692.       Caption         =   "Red Gamma "
  693.       Height          =   255
  694.       Left            =   3000
  695.       TabIndex        =   7
  696.       Top             =   3360
  697.       Width           =   915
  698.    End
  699.    Begin VB.Label Label1 
  700.       BackStyle       =   0  'Transparent
  701.       Caption         =   "Contrast"
  702.       Height          =   255
  703.       Left            =   120
  704.       TabIndex        =   6
  705.       Top             =   3360
  706.       Width           =   795
  707.    End
  708. End
  709. Attribute VB_Name = "frmEdit"
  710. Attribute VB_GlobalNameSpace = False
  711. Attribute VB_Creatable = False
  712. Attribute VB_PredeclaredId = True
  713. Attribute VB_Exposed = False
  714. Option Explicit
  715.  
  716. ' Change Color Ver. 1.0.0 27/2/2004
  717. '
  718. ' This code show how to use the COLORADJUSTMENT API.
  719. ' Only for Windows NT/2000/XP
  720. '
  721. ' This code is copyright Xip3000 -2004-
  722.  
  723. Const HALFTONE = 4
  724. Const ILLUMINANT_DEVICE_DEFAULT = 0
  725. Const ILLUMINANT_A = 1
  726. Const ILLUMINANT_B = 2
  727. Const ILLUMINANT_C = 3
  728. Const ILLUMINANT_D50 = 4
  729. Const ILLUMINANT_D55 = 5
  730. Const ILLUMINANT_D65 = 6
  731. Const ILLUMINANT_D75 = 7
  732. Const ILLUMINANT_F2 = 8
  733. Const NEGATIVE = &H1
  734. Const NORMAL = &H0
  735.  
  736. Private Type COLORADJUSTMENT
  737.         caSize As Integer
  738.         caFlags As Integer
  739.         caIlluminantIndex As Integer
  740.         caRedGamma As Integer
  741.         caGreenGamma As Integer
  742.         caBlueGamma As Integer
  743.         caReferenceBlack As Integer
  744.         caReferenceWhite As Integer
  745.         caContrast As Integer
  746.         caBrightness As Integer
  747.         caColorfulness As Integer
  748.         caRedGreenTint As Integer
  749. End Type
  750. Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
  751. Private Declare Function SetStretchBltMode Lib "gdi32" (ByVal hdc As Long, ByVal nStretchMode As Long) As Long
  752. Private Declare Function GetColorAdjustment Lib "gdi32" (ByVal hdc As Long, lpca As COLORADJUSTMENT) As Long
  753. Private Declare Function SetColorAdjustment Lib "gdi32" (ByVal hdc As Long, lpca As COLORADJUSTMENT) As Long
  754.  
  755. Private Sub Form_Load()
  756.     cmdResetLeft_Click
  757.     cmdResetMid_Click
  758. End Sub
  759.  
  760. Private Sub canvia(es As Integer)
  761.     Dim TheColor As COLORADJUSTMENT
  762.     'Get actual Color Adjustment into Picture2
  763.     GetColorAdjustment Picture2.hdc, TheColor
  764.     TheColor.caSize = Len(TheColor)
  765.  
  766.     Select Case es
  767.         Case 0
  768.         'Change Contrast
  769.             TheColor.caContrast = vs(es).Value
  770.         Case 1
  771.         'Change Red Gamma
  772.             TheColor.caRedGamma = vs(es).Value
  773.         Case 2
  774.         'Change Green Gamma
  775.             TheColor.caGreenGamma = vs(es).Value
  776.         Case 3
  777.         'Change Blue Gamma
  778.             TheColor.caBlueGamma = vs(es).Value
  779.         Case 4
  780.         'Change Brightness
  781.             TheColor.caBrightness = vs(es).Value
  782.         Case 5
  783.         'Change Red Green Tint
  784.             TheColor.caRedGreenTint = vs(es).Value
  785.         Case 6
  786.         'Change to Color/BN or BN/Color
  787.             TheColor.caColorfulness = vs(es).Value
  788.         Case 7
  789.         'Change Reference White
  790.             TheColor.caReferenceWhite = vs(es).Value
  791.         Case 8
  792.         'Change Reference Black
  793.             TheColor.caReferenceBlack = vs(es).Value
  794.         Case 9
  795.         'Change Illuminant to default
  796.             TheColor.caIlluminantIndex = ILLUMINANT_DEVICE_DEFAULT
  797.         Case 10
  798.         'Change Illuminant to Tungsten lamp
  799.             TheColor.caIlluminantIndex = ILLUMINANT_A
  800.         Case 11
  801.         'Change Illuminant to Noon sunlight
  802.             TheColor.caIlluminantIndex = ILLUMINANT_B
  803.         Case 12
  804.         'Change Illuminant to NTSC daylight
  805.             TheColor.caIlluminantIndex = ILLUMINANT_C
  806.         Case 13
  807.         'Change Illuminant to Normal print
  808.             TheColor.caIlluminantIndex = ILLUMINANT_D50
  809.         Case 14
  810.         'Change Illuminant to Bond paper print
  811.             TheColor.caIlluminantIndex = ILLUMINANT_D55
  812.         Case 15
  813.         'Change Illuminant to Northern daylight
  814.             TheColor.caIlluminantIndex = ILLUMINANT_D75
  815.         Case 16
  816.         'Change Illuminant to Cool white lamp or Fluorescent
  817.             TheColor.caIlluminantIndex = ILLUMINANT_F2
  818.         Case 17
  819.         'Change the image to Negative or Normal
  820.             If Check1 Then
  821.                 TheColor.caFlags = NEGATIVE 'Negative
  822.             Else
  823.                 TheColor.caFlags = NORMAL 'Normal
  824.             End If
  825.     End Select
  826.  
  827.     'Set the Picture2 to HALFTONE
  828.     SetStretchBltMode Picture2.hdc, HALFTONE
  829.     
  830.     'Set the parametres to Picture2
  831.     SetColorAdjustment Picture2.hdc, TheColor
  832.  
  833.     'Copy the picture from Picture1 to Picture2
  834.     StretchBlt Picture2.hdc, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, Picture1.hdc, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, vbSrcCopy
  835.     
  836.     If Not es > 8 Then
  837.         Text1(es) = vs(es).Value
  838.     End If
  839. End Sub
  840.  
  841. Private Sub Check1_Click()
  842.     canvia (17)
  843. End Sub
  844.  
  845. Private Sub cmdExit_Click()
  846.    frmEdit.Hide
  847.    frmMain.Show
  848.    If frmEdit.Width = 10455 Then cmdExpand_Click
  849. End Sub
  850.  
  851. Private Sub cmdExpand_Click()
  852.    If frmEdit.Width = 10455 Then
  853.       frmEdit.Width = 6510
  854.       cmdExpand.Caption = "Expand"
  855.    Else
  856.       frmEdit.Width = 10455
  857.       cmdExpand.Caption = "Reduce"
  858.    End If
  859. End Sub
  860.  
  861. Private Sub cmdOpenPix_Click()
  862.     On Error GoTo error:
  863.  
  864.     With cde
  865.         .DialogTitle = "Open Picture"
  866.         .Filter = "Pictures (*.Bmp *.Jpg *.Gif *.Png)|*.bmp; *.jpg; *.gif; *.png"
  867.         .ShowOpen
  868.         
  869.    Dim stg As String
  870.    Dim token As Long
  871.     
  872.     stg = LCase(Right$(cde.FileName, 4))                             'change any upper case extensions to lower case
  873.       
  874.       If stg = ".bmp" Or stg = ".jpg" Or stg = "jpeg" Or stg = ".ico" Or stg = ".gif" Or stg = ".wmf" Or stg = _
  875.          ".avi" Or stg = ".png" Then                                         'excepted formats ... process
  876.          
  877.          If stg = ".png" = True Then
  878.             token = InitGDIPlus
  879.             Image1.Picture = LoadPictureGDIPlus(cde.FileName)
  880.             Picture1.Width = Image1.Width
  881.             Picture1.Height = Image1.Height
  882.             Picture2.Width = Picture1.Width
  883.             Picture2.Height = Picture1.Height
  884.             ResizePixBox Picture1, Image1, Picture1.Height, Picture1.Width, True
  885.             Picture1.Picture = Picture1.Image
  886.             Picture2.Picture = Picture1.Picture
  887.             FreeGDIPlus token
  888.          Else
  889.              Image1.Picture = LoadPicture(cde.FileName)
  890.              Picture1.Width = Image1.Width
  891.              Picture1.Height = Image1.Height
  892.              Picture2.Width = Picture1.Width
  893.              Picture2.Height = Picture1.Height
  894.              ResizePixBox Picture1, Image1, Picture1.Height, Picture1.Width, True
  895.              Picture1.Picture = Picture1.Image
  896.              Picture2.Picture = Picture1.Picture
  897.          End If
  898.       End If
  899.     End With
  900.     Exit Sub
  901. error:
  902.     Err.Clear
  903. End Sub
  904.  
  905. Private Sub cmdOkay_Click()
  906.    StretchBlt frmMain.picDisplay(frmMain.SelPos).hdc, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, Picture2.hdc, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, vbSrcCopy
  907.    If frmEdit.Width = 10455 Then cmdExpand_Click
  908.    frmEdit.Hide
  909.    frmMain.Show
  910.    frmMain.cmdSPP.Enabled = True
  911. End Sub
  912.  
  913. Public Sub cmdResetLeft_Click()
  914.    vs(0).Value = 0
  915.    canvia (0)
  916.    vs(4).Value = 0
  917.    canvia 4
  918.    vs(6).Value = 0
  919.    canvia 6
  920. End Sub
  921.  
  922. Public Sub cmdResetMid_Click()
  923.    vs(1).Value = 10000
  924.    canvia 1
  925.    vs(2).Value = 10000
  926.    canvia 2
  927.    vs(3).Value = 10000
  928.    canvia 3
  929. End Sub
  930.  
  931. Private Sub cmdResetWB_Click()
  932.    vs(7).Value = 10000
  933.    canvia 7
  934.    vs(8).Value = 0
  935.    canvia 8
  936. End Sub
  937.  
  938. Private Sub cmdResetRGT_Click()
  939.    vs(5).Value = 0
  940.    canvia 5
  941. End Sub
  942.  
  943. Private Sub Option1_Click(Index As Integer)
  944.     canvia (Index)
  945. End Sub
  946.  
  947. Private Sub VS_Change(Index As Integer)
  948.     VS_scroll (Index)
  949. End Sub
  950.  
  951. Private Sub VS_scroll(Index As Integer)
  952.     canvia (Index)
  953. End Sub
  954.