home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 5 / MasteringVisualBasic5.iso / olympus / ik32_15t / vb4.shr / Assign.frm (.txt) next >
Encoding:
Visual Basic Form  |  1996-07-23  |  8.9 KB  |  289 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Assign"
  5.    ClientHeight    =   4590
  6.    ClientLeft      =   1170
  7.    ClientTop       =   2400
  8.    ClientWidth     =   8055
  9.    Height          =   5280
  10.    Left            =   1110
  11.    LinkTopic       =   "Form1"
  12.    LockControls    =   -1  'True
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   4590
  16.    ScaleWidth      =   8055
  17.    Top             =   1770
  18.    Width           =   8175
  19.    Begin VB.Frame Frame2 
  20.       Caption         =   "Destination Picbuf Selection"
  21.       Height          =   615
  22.       Left            =   4080
  23.       TabIndex        =   11
  24.       Top             =   3240
  25.       Width           =   2415
  26.       Begin VB.OptionButton OptDestSel 
  27.          Caption         =   "Selection"
  28.          Height          =   255
  29.          Left            =   1320
  30.          TabIndex        =   7
  31.          Top             =   240
  32.          Width           =   975
  33.       End
  34.       Begin VB.OptionButton OptDestFull 
  35.          Caption         =   "Full Image"
  36.          Height          =   255
  37.          Left            =   120
  38.          TabIndex        =   6
  39.          Top             =   240
  40.          Width           =   1455
  41.       End
  42.    End
  43.    Begin VB.Frame Frame1 
  44.       Caption         =   "Source Picbuf Selection"
  45.       Height          =   615
  46.       Left            =   120
  47.       TabIndex        =   10
  48.       Top             =   3240
  49.       Width           =   2415
  50.       Begin VB.OptionButton OptSrcSel 
  51.          Caption         =   "Selection"
  52.          Height          =   255
  53.          Left            =   1320
  54.          TabIndex        =   5
  55.          Top             =   240
  56.          Width           =   975
  57.       End
  58.       Begin VB.OptionButton OptSrcFull 
  59.          Caption         =   "Full Image"
  60.          Height          =   255
  61.          Left            =   120
  62.          TabIndex        =   4
  63.          Top             =   240
  64.          Width           =   1455
  65.       End
  66.    End
  67.    Begin VB.ComboBox CmbResizeMode 
  68.       Height          =   315
  69.       Left            =   4080
  70.       TabIndex        =   3
  71.       Text            =   "cmbResizeMode"
  72.       Top             =   4200
  73.       Width           =   3855
  74.    End
  75.    Begin VB.ComboBox CmbAssignMode 
  76.       Height          =   315
  77.       Left            =   120
  78.       TabIndex        =   2
  79.       Text            =   "cmbAssignMode"
  80.       Top             =   4200
  81.       Width           =   3855
  82.    End
  83.    Begin VB.CommandButton CmdSrcToDestAssign 
  84.       Caption         =   "Assign To &Destination"
  85.       Height          =   495
  86.       Left            =   2640
  87.       TabIndex        =   0
  88.       Top             =   3360
  89.       Width           =   1335
  90.    End
  91.    Begin VB.CommandButton CmdDestToSrcAssign 
  92.       Caption         =   "Assign To &Source"
  93.       Height          =   495
  94.       Left            =   6600
  95.       TabIndex        =   1
  96.       Top             =   3360
  97.       Width           =   1335
  98.    End
  99.    Begin ik32Lib.Picbuf PicbufDest 
  100.       Height          =   2895
  101.       Left            =   4080
  102.       TabIndex        =   9
  103.       TabStop         =   0   'False
  104.       Top             =   240
  105.       Width           =   3855
  106.       _Version        =   65536
  107.       _ExtentX        =   6800
  108.       _ExtentY        =   5106
  109.       _StockProps     =   253
  110.    End
  111.    Begin ik32Lib.Picbuf PicbufSrc 
  112.       Height          =   2895
  113.       Left            =   120
  114.       TabIndex        =   8
  115.       TabStop         =   0   'False
  116.       Top             =   240
  117.       Width           =   3855
  118.       _Version        =   65536
  119.       _ExtentX        =   6800
  120.       _ExtentY        =   5106
  121.       _StockProps     =   253
  122.    End
  123.    Begin MSComDlg.CommonDialog CommonDialog1 
  124.       Left            =   5730
  125.       Top             =   3870
  126.       _Version        =   65536
  127.       _ExtentX        =   847
  128.       _ExtentY        =   847
  129.       _StockProps     =   0
  130.    End
  131.    Begin VB.Label Label2 
  132.       Caption         =   "Resize Mode:"
  133.       Height          =   255
  134.       Left            =   4080
  135.       TabIndex        =   13
  136.       Top             =   3960
  137.       Width           =   1455
  138.    End
  139.    Begin VB.Label Label1 
  140.       Caption         =   "Assign Mode:"
  141.       Height          =   255
  142.       Left            =   120
  143.       TabIndex        =   12
  144.       Top             =   3960
  145.       Width           =   1575
  146.    End
  147.    Begin VB.Label Label3 
  148.       Caption         =   "Source Picbuf"
  149.       Height          =   255
  150.       Left            =   120
  151.       TabIndex        =   14
  152.       Top             =   0
  153.       Width           =   1815
  154.    End
  155.    Begin VB.Label Label4 
  156.       Caption         =   "Destination Picbuf"
  157.       Height          =   255
  158.       Left            =   4080
  159.       TabIndex        =   15
  160.       Top             =   0
  161.       Width           =   2055
  162.    End
  163.    Begin VB.Menu mnuFile 
  164.       Caption         =   "&File"
  165.       Begin VB.Menu mnuLoadSrc 
  166.          Caption         =   "&Load Source Image..."
  167.       End
  168.       Begin VB.Menu mnuLoadDest 
  169.          Caption         =   "Load &Destination Image..."
  170.       End
  171.       Begin VB.Menu mnuSaveSrc 
  172.          Caption         =   "&Save Source Image..."
  173.       End
  174.       Begin VB.Menu SaveDest 
  175.          Caption         =   "Save D&estination Image..."
  176.       End
  177.       Begin VB.Menu mnuSpacer 
  178.          Caption         =   "-"
  179.       End
  180.       Begin VB.Menu mnuExit 
  181.          Caption         =   "E&xit"
  182.          Shortcut        =   ^X
  183.       End
  184.    End
  185.    Begin VB.Menu mnuReload 
  186.       Caption         =   "&Reload"
  187.    End
  188. Attribute VB_Name = "Form1"
  189. Attribute VB_Creatable = False
  190. Attribute VB_Exposed = False
  191. Option Explicit
  192. 'Description: This event code decides which assign
  193. 'mode to use.
  194. Private Sub CmbAssignMode_Click()
  195.     'Set Assign Mode values according to combo box data
  196.     PicbufSrc.AssignMode = Val(Left(cmbAssignMode.Text, 1))
  197.     PicbufDest.AssignMode = Val(Left(cmbAssignMode.Text, 1))
  198. End Sub
  199. 'Description: This event code is used to decide
  200. 'which resize mode is used.
  201. Private Sub CmbResizeMode_Click()
  202.     'Set Assign Mode values according to combo box data
  203.     PicbufSrc.ResizeMode = Val(Left(cmbResizeMode.Text, 1))
  204.     PicbufDest.ResizeMode = Val(Left(cmbResizeMode.Text, 1))
  205. End Sub
  206. 'Description: Uses assign method to transfer an
  207. 'image from PicBufDest to PicBufSrc.
  208. Private Sub CmdDestToSrcAssign_Click()
  209.     'Invoke the Assign method.
  210.     PicbufSrc.Assign OptSrcSel.Value, PicbufDest, OptDestSel.Value
  211. End Sub
  212. 'Description: Uses assign method to transfer an
  213. 'image from PicBufSrc to PicBufDest.
  214. Private Sub CmdSrcToDestAssign_Click()
  215.     'Invoke the Assign method
  216.     PicbufDest.Assign OptDestSel.Value, PicbufSrc, OptSrcSel.Value
  217. End Sub
  218. Private Sub Form_Load()
  219.     'Set values for Assign Mode combo box
  220.     InitCmbAssignMode cmbAssignMode
  221.     'Set values for Resize Mode combo box
  222.     InitcmbResizeMode cmbResizeMode
  223.     'Set initial Option values
  224.     OptSrcFull.Value = True
  225.     OptDestFull.Value = True
  226.     'Set image locations
  227.     InitPicbuf PicbufSrc, True, "leaves8.pcx"
  228.     InitPicbuf PicbufDest, True, "marybeth.tif"
  229.     'Set selection areas for PicbufSrc & PicbufDest
  230.     SetSelect PicbufSrc, 70, 30, 100, 100
  231.     PicbufSrc.ForeColor = 255
  232.     SetSelect PicbufDest, 40, 40, 100, 100
  233.     'Set drawing color for PicbufSrc & PicbufDest
  234.     PicbufDest.ForeColor = 255
  235.     PicbufSrc.ForeColor = 255
  236. End Sub
  237. 'Description: This module closes the program.
  238. Private Sub mnuExit_Click()
  239.     ExitProgram
  240. End Sub
  241. 'Description: This module uses the common dialog
  242. 'control to load an image.
  243. Private Sub mnuLoadDest_Click()
  244.     LoadImage PicbufDest, CommonDialog1
  245. End Sub
  246. 'Description: This module uses the common dialog
  247. 'control to load an image.
  248. Private Sub mnuLoadSrc_Click()
  249.     LoadImage PicbufSrc, CommonDialog1
  250. End Sub
  251. 'Description: Reloads the images into the PicBufs.
  252. Private Sub mnuReload_Click()
  253.     'Reload original images
  254.     PicbufSrc.Load
  255.     PicbufDest.Load
  256.     OptSrcFull.Value = True
  257.     OptDestFull.Value = True
  258. End Sub
  259. 'Description: This module uses the common dialog
  260. 'control to save an image.
  261. Private Sub mnuSaveSrc_Click()
  262.     SaveImage PicbufSrc, CommonDialog1
  263. End Sub
  264. 'Description: This code erases the box drawn on
  265. 'the picbuf.
  266. Private Sub OptDestFull_Click()
  267.     PicbufDest.Refresh
  268. End Sub
  269. 'Description: This code draws a rectangle on the
  270. 'picbuf
  271. Private Sub OptDestSel_Click()
  272. PicbufDest.Rect 1
  273. End Sub
  274. 'Description: This code erases the box drawn on
  275. 'the picbuf.
  276. Private Sub OptSrcFull_Click()
  277.     PicbufSrc.Refresh
  278. End Sub
  279. 'Description: This code draws a rectangle on the
  280. 'picbuf
  281. Private Sub OptSrcSel_Click()
  282. PicbufSrc.Rect 1
  283. End Sub
  284. 'Description: This module uses the common dialog
  285. 'control to save an image.
  286. Private Sub SaveDest_Click()
  287.     SaveImage PicbufDest, CommonDialog1
  288. End Sub
  289.