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

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Image Information"
  5.    ClientHeight    =   3690
  6.    ClientLeft      =   1995
  7.    ClientTop       =   2985
  8.    ClientWidth     =   6585
  9.    Height          =   4380
  10.    Left            =   1935
  11.    LinkTopic       =   "Form1"
  12.    LockControls    =   -1  'True
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   3690
  16.    ScaleWidth      =   6585
  17.    Top             =   2355
  18.    Width           =   6705
  19.    Begin VB.Frame Frame2 
  20.       Caption         =   "Image"
  21.       Height          =   2595
  22.       Left            =   3600
  23.       TabIndex        =   5
  24.       Top             =   960
  25.       Width           =   2895
  26.       Begin VB.Label lblBPal 
  27.          Caption         =   "lblBPal"
  28.          Height          =   195
  29.          Left            =   2430
  30.          TabIndex        =   29
  31.          Top             =   1710
  32.          Width           =   375
  33.       End
  34.       Begin VB.Label lblGPal 
  35.          Caption         =   "lblGPal"
  36.          Height          =   195
  37.          Left            =   1890
  38.          TabIndex        =   28
  39.          Top             =   1710
  40.          Width           =   375
  41.       End
  42.       Begin VB.Label lblRPal 
  43.          Caption         =   "lblRPal"
  44.          Height          =   195
  45.          Left            =   1350
  46.          TabIndex        =   27
  47.          Top             =   1710
  48.          Width           =   375
  49.       End
  50.       Begin VB.Label lblBCol 
  51.          Caption         =   "lblBCol"
  52.          Height          =   195
  53.          Left            =   2430
  54.          TabIndex        =   26
  55.          Top             =   1170
  56.          Width           =   375
  57.       End
  58.       Begin VB.Label lblGCol 
  59.          Caption         =   "lblGCol"
  60.          Height          =   195
  61.          Left            =   1890
  62.          TabIndex        =   25
  63.          Top             =   1170
  64.          Width           =   375
  65.       End
  66.       Begin VB.Label lblRCol 
  67.          Caption         =   "lblRCol"
  68.          Height          =   195
  69.          Left            =   1350
  70.          TabIndex        =   24
  71.          Top             =   1170
  72.          Width           =   375
  73.       End
  74.       Begin VB.Label Label15 
  75.          Caption         =   "B:"
  76.          Height          =   195
  77.          Left            =   2250
  78.          TabIndex        =   23
  79.          Top             =   1710
  80.          Width           =   195
  81.       End
  82.       Begin VB.Label Label14 
  83.          Caption         =   "G:"
  84.          Height          =   195
  85.          Left            =   1710
  86.          TabIndex        =   22
  87.          Top             =   1710
  88.          Width           =   195
  89.       End
  90.       Begin VB.Label Label13 
  91.          Caption         =   "R:"
  92.          Height          =   195
  93.          Left            =   1170
  94.          TabIndex        =   21
  95.          Top             =   1710
  96.          Width           =   285
  97.       End
  98.       Begin VB.Label Label12 
  99.          Caption         =   "B:"
  100.          Height          =   195
  101.          Left            =   2250
  102.          TabIndex        =   20
  103.          Top             =   1170
  104.          Width           =   195
  105.       End
  106.       Begin VB.Label Label11 
  107.          Caption         =   "G:"
  108.          Height          =   195
  109.          Left            =   1710
  110.          TabIndex        =   19
  111.          Top             =   1170
  112.          Width           =   195
  113.       End
  114.       Begin VB.Label Label10 
  115.          Caption         =   "R:"
  116.          Height          =   195
  117.          Left            =   1170
  118.          TabIndex        =   18
  119.          Top             =   1170
  120.          Width           =   285
  121.       End
  122.       Begin VB.Shape Shape1 
  123.          FillStyle       =   0  'Solid
  124.          Height          =   465
  125.          Left            =   120
  126.          Top             =   1980
  127.          Width           =   2625
  128.       End
  129.       Begin VB.Label Label6 
  130.          Caption         =   "Palette Color:"
  131.          Height          =   255
  132.          Left            =   90
  133.          TabIndex        =   15
  134.          Top             =   1680
  135.          Width           =   975
  136.       End
  137.       Begin VB.Label lblHeight 
  138.          Caption         =   "lblHeight"
  139.          Height          =   255
  140.          Left            =   1170
  141.          TabIndex        =   14
  142.          Top             =   540
  143.          Width           =   735
  144.       End
  145.       Begin VB.Label lblWidth 
  146.          Caption         =   "lblWidth"
  147.          Height          =   255
  148.          Left            =   1170
  149.          TabIndex        =   13
  150.          Top             =   270
  151.          Width           =   735
  152.       End
  153.       Begin VB.Label Label4 
  154.          Caption         =   "Height:"
  155.          Height          =   255
  156.          Left            =   90
  157.          TabIndex        =   12
  158.          Top             =   540
  159.          Width           =   615
  160.       End
  161.       Begin VB.Label Label3 
  162.          Caption         =   "Width:"
  163.          Height          =   255
  164.          Left            =   90
  165.          TabIndex        =   11
  166.          Top             =   270
  167.          Width           =   495
  168.       End
  169.       Begin VB.Label lblPalIndex 
  170.          Caption         =   "lblPalIndex"
  171.          Height          =   255
  172.          Left            =   1200
  173.          TabIndex        =   10
  174.          Top             =   1440
  175.          Width           =   735
  176.       End
  177.       Begin VB.Label Label9 
  178.          Caption         =   "Palette Index:"
  179.          Height          =   255
  180.          Left            =   90
  181.          TabIndex        =   9
  182.          Top             =   1440
  183.          Width           =   1095
  184.       End
  185.       Begin VB.Label Label7 
  186.          Caption         =   "Color:"
  187.          Height          =   255
  188.          Left            =   90
  189.          TabIndex        =   8
  190.          Top             =   1170
  191.          Width           =   495
  192.       End
  193.       Begin VB.Label lblBitDepth 
  194.          Caption         =   "lblBitDepth"
  195.          Height          =   255
  196.          Left            =   1170
  197.          TabIndex        =   7
  198.          Top             =   810
  199.          Width           =   735
  200.       End
  201.       Begin VB.Label Label5 
  202.          Caption         =   "Bit Depth:"
  203.          Height          =   255
  204.          Left            =   90
  205.          TabIndex        =   6
  206.          Top             =   810
  207.          Width           =   855
  208.       End
  209.    End
  210.    Begin VB.Frame Frame1 
  211.       Caption         =   "Cursor"
  212.       Height          =   855
  213.       Left            =   3600
  214.       TabIndex        =   0
  215.       Top             =   0
  216.       Width           =   2895
  217.       Begin VB.Label lblYPos 
  218.          Caption         =   "lblYPos"
  219.          Height          =   255
  220.          Left            =   1170
  221.          TabIndex        =   4
  222.          Top             =   480
  223.          Width           =   735
  224.       End
  225.       Begin VB.Label lblXPos 
  226.          Caption         =   "lblXPos"
  227.          Height          =   255
  228.          Left            =   1170
  229.          TabIndex        =   3
  230.          Top             =   240
  231.          Width           =   735
  232.       End
  233.       Begin VB.Label Label2 
  234.          Caption         =   "Y Position:"
  235.          Height          =   255
  236.          Left            =   90
  237.          TabIndex        =   2
  238.          Top             =   480
  239.          Width           =   1095
  240.       End
  241.       Begin VB.Label Label1 
  242.          Caption         =   "X Position:"
  243.          Height          =   255
  244.          Left            =   90
  245.          TabIndex        =   1
  246.          Top             =   240
  247.          Width           =   855
  248.       End
  249.    End
  250.    Begin ik32Lib.Picbuf Picbuf1 
  251.       Height          =   3375
  252.       Left            =   120
  253.       TabIndex        =   16
  254.       Top             =   0
  255.       Width           =   3375
  256.       _Version        =   65536
  257.       _ExtentX        =   5953
  258.       _ExtentY        =   5953
  259.       _StockProps     =   253
  260.    End
  261.    Begin VB.Label Label8 
  262.       Alignment       =   2  'Center
  263.       Caption         =   "Click on image for color information"
  264.       Height          =   195
  265.       Left            =   90
  266.       TabIndex        =   17
  267.       Top             =   3420
  268.       Width           =   3435
  269.    End
  270.    Begin MSComDlg.CommonDialog CommonDialog1 
  271.       Left            =   3000
  272.       Top             =   480
  273.       _Version        =   65536
  274.       _ExtentX        =   847
  275.       _ExtentY        =   847
  276.       _StockProps     =   0
  277.    End
  278.    Begin VB.Menu mnuFile 
  279.       Caption         =   "&File"
  280.       Begin VB.Menu mnuLoad 
  281.          Caption         =   "&Load Image..."
  282.       End
  283.       Begin VB.Menu mnuSpacer 
  284.          Caption         =   "-"
  285.       End
  286.       Begin VB.Menu mnuExit 
  287.          Caption         =   "E&xit"
  288.          Shortcut        =   ^X
  289.       End
  290.    End
  291. Attribute VB_Name = "Form1"
  292. Attribute VB_Creatable = False
  293. Attribute VB_Exposed = False
  294. Option Explicit
  295. 'Description: This code clears the captions of
  296. 'labels on the screen
  297. Sub InitImageInfo()
  298.     'set label captions to image data values
  299.     lblBitDepth.Caption = Picbuf1.ColorDepth
  300.     lblWidth.Caption = Picbuf1.Xresolution
  301.     lblHeight.Caption = Picbuf1.Yresolution
  302.     'clear other labels
  303.     lblRCol.Caption = ""
  304.     lblGCol.Caption = ""
  305.     lblBCol.Caption = ""
  306.     lblRPal.Caption = ""
  307.     lblGPal.Caption = ""
  308.     lblBPal.Caption = ""
  309.     lblPalIndex.Caption = ""
  310.     Shape1.FillColor = 0
  311. End Sub
  312. 'Description: This code initializes all presets
  313. Private Sub Form_Load()
  314.     'Set picbuf properties
  315.     InitPicbuf Picbuf1, True, "marybeth.tif"
  316.     InitImageInfo
  317.     Picbuf1.MousePointer = MPCross  'set cursor to cross hair
  318. End Sub
  319. 'Description: This code ends the program
  320. Private Sub mnuExit_Click()
  321.     ExitProgram
  322. End Sub
  323. 'Description: This code loads an image using the
  324. 'Common Dialog control. It then sets the value of
  325. 'several text boxes, according to information about
  326. 'the image.
  327. Private Sub mnuLoad_Click()
  328.     LoadImage Picbuf1, CommonDialog1
  329.     InitImageInfo
  330. End Sub
  331. 'Description: This sets the color of a shape control
  332. 'to the color being clicked on
  333. Private Sub Picbuf1_Click()
  334.     Dim nColor, nPalColor As Long
  335.     'set color & palette labels
  336.     If Val(lblXPos.Caption) <> -1 And Val(lblXPos.Caption) < Val(lblWidth.Caption) And Val(lblYPos.Caption) <> -1 And Val(lblYPos.Caption) < Val(lblHeight) Then
  337.         If Picbuf1.ColorDepth = 24 Then
  338.             nColor = Picbuf1.GetColor(Val(lblXPos.Caption), Val(lblYPos.Caption))
  339.         Else
  340.             lblPalIndex.Caption = Picbuf1.GetPalIndex(Val(lblXPos.Caption), Val(lblYPos.Caption))
  341.             nPalColor = Picbuf1.GetPalColor(Val(lblPalIndex.Caption))
  342.             nColor = Picbuf1.GetColor(Val(lblXPos.Caption), Val(lblYPos.Caption))
  343.             
  344.             lblRPal.Caption = getRed(Val(nPalColor))
  345.             lblGPal.Caption = getGreen(Val(nPalColor))
  346.             lblBPal.Caption = GetBlue(Val(nPalColor))
  347.         End If
  348.         lblRCol.Caption = getRed(Val(nColor))
  349.         lblGCol.Caption = getGreen(Val(nColor))
  350.         lblBCol.Caption = GetBlue(Val(nColor))
  351.     End If
  352.     Shape1.FillColor = Val(nColor)
  353. End Sub
  354. 'Description: this code updates the values of text
  355. 'boxes according to the information about the
  356. 'selected pixel
  357. Private Sub Picbuf1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  358.     'set x&y position labels
  359.     lblXPos.Caption = Picbuf1.ScreenToImageX(X / Screen.TwipsPerPixelX)
  360.     lblYPos.Caption = Picbuf1.ScreenToImageY(Y / Screen.TwipsPerPixelY)
  361. End Sub
  362.