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

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Picture"
  5.    ClientHeight    =   4575
  6.    ClientLeft      =   555
  7.    ClientTop       =   1125
  8.    ClientWidth     =   9255
  9.    Height          =   5265
  10.    Left            =   495
  11.    LinkTopic       =   "Form1"
  12.    LockControls    =   -1  'True
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   305
  16.    ScaleMode       =   3  'Pixel
  17.    ScaleWidth      =   617
  18.    Top             =   495
  19.    Width           =   9375
  20.    Begin VB.PictureBox Picture1 
  21.       Height          =   3735
  22.       Left            =   5280
  23.       ScaleHeight     =   3675
  24.       ScaleWidth      =   3795
  25.       TabIndex        =   7
  26.       Top             =   240
  27.       Width           =   3855
  28.    End
  29.    Begin VB.CommandButton cmdCircular 
  30.       Caption         =   "DibToBitmap --> BitmapToDib"
  31.       Height          =   375
  32.       Left            =   720
  33.       TabIndex        =   6
  34.       Top             =   4080
  35.       Width           =   2535
  36.    End
  37.    Begin VB.CommandButton cmdBmToPb 
  38.       Caption         =   "Bitmap To Picbuf"
  39.       Height          =   495
  40.       Left            =   4080
  41.       TabIndex        =   5
  42.       Top             =   1200
  43.       Width           =   1095
  44.    End
  45.    Begin VB.CommandButton cmdPbToPict 
  46.       Caption         =   "Picbuf To Picture"
  47.       Height          =   495
  48.       Left            =   4080
  49.       TabIndex        =   2
  50.       Top             =   3480
  51.       Width           =   1095
  52.    End
  53.    Begin VB.CommandButton cmdPictToPb 
  54.       Caption         =   "Picture To Picbuf"
  55.       Height          =   495
  56.       Left            =   4080
  57.       TabIndex        =   1
  58.       Top             =   240
  59.       Width           =   1095
  60.    End
  61.    Begin ik32Lib.Picbuf Picbuf1 
  62.       Height          =   3735
  63.       Left            =   120
  64.       TabIndex        =   0
  65.       Top             =   240
  66.       Width           =   3855
  67.       _Version        =   65536
  68.       _ExtentX        =   6800
  69.       _ExtentY        =   6588
  70.       _StockProps     =   253
  71.       BackColor       =   0
  72.    End
  73.    Begin VB.Line Line14 
  74.       X1              =   240
  75.       X2              =   248
  76.       Y1              =   272
  77.       Y2              =   280
  78.    End
  79.    Begin VB.Line Line13 
  80.       X1              =   240
  81.       X2              =   232
  82.       Y1              =   272
  83.       Y2              =   280
  84.    End
  85.    Begin VB.Line Line12 
  86.       X1              =   240
  87.       X2              =   240
  88.       Y1              =   288
  89.       Y2              =   272
  90.    End
  91.    Begin VB.Line Line11 
  92.       X1              =   224
  93.       X2              =   240
  94.       Y1              =   288
  95.       Y2              =   288
  96.    End
  97.    Begin VB.Line Line10 
  98.       X1              =   32
  99.       X2              =   40
  100.       Y1              =   296
  101.       Y2              =   288
  102.    End
  103.    Begin VB.Line Line9 
  104.       X1              =   32
  105.       X2              =   40
  106.       Y1              =   280
  107.       Y2              =   288
  108.    End
  109.    Begin VB.Line Line8 
  110.       X1              =   24
  111.       X2              =   40
  112.       Y1              =   288
  113.       Y2              =   288
  114.    End
  115.    Begin VB.Line Line7 
  116.       X1              =   24
  117.       X2              =   24
  118.       Y1              =   272
  119.       Y2              =   288
  120.    End
  121.    Begin VB.Line Line6 
  122.       X1              =   336
  123.       X2              =   344
  124.       Y1              =   208
  125.       Y2              =   216
  126.    End
  127.    Begin VB.Line Line5 
  128.       X1              =   344
  129.       X2              =   336
  130.       Y1              =   216
  131.       Y2              =   224
  132.    End
  133.    Begin VB.Line Line4 
  134.       X1              =   272
  135.       X2              =   344
  136.       Y1              =   216
  137.       Y2              =   216
  138.    End
  139.    Begin VB.Line Line3 
  140.       X1              =   272
  141.       X2              =   280
  142.       Y1              =   64
  143.       Y2              =   72
  144.    End
  145.    Begin VB.Line Line2 
  146.       X1              =   272
  147.       X2              =   280
  148.       Y1              =   64
  149.       Y2              =   56
  150.    End
  151.    Begin VB.Line Line1 
  152.       X1              =   344
  153.       X2              =   272
  154.       Y1              =   64
  155.       Y2              =   64
  156.    End
  157.    Begin VB.Label Label2 
  158.       Appearance      =   0  'Flat
  159.       Caption         =   "Microsoft Picture Control"
  160.       ForeColor       =   &H80000008&
  161.       Height          =   255
  162.       Left            =   5280
  163.       TabIndex        =   4
  164.       Top             =   0
  165.       Width           =   1815
  166.    End
  167.    Begin VB.Label Label1 
  168.       Appearance      =   0  'Flat
  169.       Caption         =   "ImageKnife Picbuf Control"
  170.       ForeColor       =   &H80000008&
  171.       Height          =   255
  172.       Left            =   120
  173.       TabIndex        =   3
  174.       Top             =   0
  175.       Width           =   1935
  176.    End
  177.    Begin MSComDlg.CommonDialog CommonDialog1 
  178.       Left            =   4320
  179.       Top             =   2160
  180.       _Version        =   65536
  181.       _ExtentX        =   847
  182.       _ExtentY        =   847
  183.       _StockProps     =   0
  184.    End
  185.    Begin VB.Menu mnuFile 
  186.       Caption         =   "&File"
  187.       Begin VB.Menu mnuLoadPicbuf 
  188.          Caption         =   "&Load Picbuf Image..."
  189.       End
  190.       Begin VB.Menu mnuLoadPicBox 
  191.          Caption         =   "Load &Picture Box Image..."
  192.       End
  193.       Begin VB.Menu mnuSpacer 
  194.          Caption         =   "-"
  195.       End
  196.       Begin VB.Menu mnuExit 
  197.          Caption         =   "E&xit"
  198.          Shortcut        =   ^X
  199.       End
  200.    End
  201.    Begin VB.Menu mnuReload 
  202.       Caption         =   "&Reload"
  203.    End
  204.    Begin VB.Menu mnuClear 
  205.       Caption         =   "&Clear"
  206.       Begin VB.Menu mnuClearPicbuf 
  207.          Caption         =   "&Picbuf"
  208.       End
  209.       Begin VB.Menu mnuClearPicture 
  210.          Caption         =   "P&icture Box"
  211.       End
  212.    End
  213. Attribute VB_Name = "Form1"
  214. Attribute VB_Creatable = False
  215. Attribute VB_Exposed = False
  216. 'Description: This code converts a bitmap to a
  217. 'device independent bitmap.
  218. Private Sub cmdBmToPb_Click()
  219.     Picbuf1.BitmapToDib Picture1.Image
  220. End Sub
  221. 'Description: This code switches the image in the
  222. 'picbuf from a dib to a bitmap, and then from a
  223. 'bitmap back into a dib.
  224. Private Sub cmdCircular_Click()
  225.     Dim handle As Integer
  226.     handle = Picbuf1.DibToBitmap
  227.     Picbuf1.Clear
  228.     Picbuf1.BitmapToDib handle
  229. End Sub
  230. 'Description: This code transfers the image in the
  231. 'picture box to the picbuf.
  232. Private Sub cmdPbToPict_Click()
  233.     Picture1.Picture = Picbuf1.Picture
  234. End Sub
  235. 'Description: This code transfers an image from the
  236. 'picbuf to the picture box.
  237. Private Sub cmdPictToPb_Click()
  238.     Picbuf1.Picture = Picture1.Image
  239. End Sub
  240. 'Description: This code loads an image into the
  241. 'picbuf.
  242. Private Sub Form_Load()
  243.     InitPicbuf Picbuf1, True, "rgb24.bmp"
  244. End Sub
  245. 'Description: This code clears the image from the
  246. 'picbuf.
  247. Private Sub mnuClearPicbuf_Click()
  248.     Picbuf1.Clear
  249. End Sub
  250. 'Description: This code clears the image from the
  251. 'picture box.
  252. Private Sub mnuClearPicture_Click()
  253.     Picture1.Picture = LoadPicture("")
  254. End Sub
  255. 'Description: This code ends the program.
  256. Private Sub mnuExit_Click()
  257.     ExitProgram
  258. End Sub
  259. 'Description: This code uses the common dialog
  260. 'control to load an image into the picture box.
  261. Private Sub mnuLoadPicBox_Click()
  262.     CommonDialog1.DialogTitle = "Load Image"
  263.     CommonDialog1.Filter = "all files|*.*|BMP|*.bmp"
  264.     CommonDialog1.FilterIndex = 2
  265.     CommonDialog1.Flags = cdlOFNHideReadOnly Or cdlOFNFileMustExist
  266.     On Error GoTo Cancel_Click
  267.     CommonDialog1.CancelError = True
  268.     CommonDialog1.ShowOpen
  269.     Picture1.Picture = LoadPicture(CommonDialog1.Filename)
  270.     Exit Sub
  271. Cancel_Click:
  272.     If Err.Number = 32755 Then
  273.         Exit Sub
  274.     Else
  275.         MsgBox Err.Description
  276.     End If
  277. End Sub
  278. 'Description: This code uses the common dialog
  279. 'control to load an image into the picbuf control.
  280. Private Sub mnuLoadPicbuf_Click()
  281.     LoadImage Picbuf1, CommonDialog1
  282. End Sub
  283. 'Description: This code reloads the image into the
  284. 'picbuf control.
  285. Private Sub mnuReload_Click()
  286.     Picbuf1.Load
  287. End Sub
  288.