home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / nimgvb10 / form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1995-12-25  |  6.6 KB  |  233 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "NEDImage VB Demo"
  4.    ClientHeight    =   4755
  5.    ClientLeft      =   1635
  6.    ClientTop       =   1905
  7.    ClientWidth     =   5355
  8.    Height          =   5445
  9.    Icon            =   "Form1.frx":0000
  10.    Left            =   1575
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   4755
  13.    ScaleWidth      =   5355
  14.    Top             =   1275
  15.    Width           =   5475
  16.    Begin NEDImage.NEDImage NEDImage1 
  17.       Height          =   6615
  18.       Left            =   0
  19.       TabIndex        =   0
  20.       Top             =   0
  21.       Width           =   9615
  22.       _Version        =   65536
  23.       _ExtentX        =   16960
  24.       _ExtentY        =   11668
  25.       _StockProps     =   1
  26.       AutoDisplay     =   -1  'True
  27.       ScrollBars      =   -1  'True
  28.    End
  29.    Begin MSComDlg.CommonDialog CommonDialog1 
  30.       Left            =   6120
  31.       Top             =   5520
  32.       _Version        =   65536
  33.       _ExtentX        =   847
  34.       _ExtentY        =   847
  35.       _StockProps     =   0
  36.       CancelError     =   -1  'True
  37.       DialogTitle     =   "Open Image"
  38.       Filter          =   $"Form1.frx":030A
  39.    End
  40.    Begin VB.Menu File 
  41.       Caption         =   "&File"
  42.       Begin VB.Menu FileOpen 
  43.          Caption         =   "&Open..."
  44.       End
  45.       Begin VB.Menu Sep1 
  46.          Caption         =   "-"
  47.       End
  48.       Begin VB.Menu PrintFile 
  49.          Caption         =   "&Print"
  50.          Enabled         =   0   'False
  51.       End
  52.       Begin VB.Menu Sep2 
  53.          Caption         =   "-"
  54.       End
  55.       Begin VB.Menu FileExit 
  56.          Caption         =   "E&xit"
  57.       End
  58.    End
  59.    Begin VB.Menu Image 
  60.       Caption         =   "&Image"
  61.       Begin VB.Menu FitType 
  62.          Caption         =   "&Fit Type"
  63.          Begin VB.Menu BestFit 
  64.             Caption         =   "&Best Fit"
  65.             Checked         =   -1  'True
  66.          End
  67.          Begin VB.Menu HorizontalFit 
  68.             Caption         =   "&Horizontal Fit"
  69.          End
  70.          Begin VB.Menu VerticalFit 
  71.             Caption         =   "&Vertical Fit"
  72.          End
  73.          Begin VB.Menu OneToOne 
  74.             Caption         =   "&One To One"
  75.          End
  76.       End
  77.       Begin VB.Menu RotateMenu 
  78.          Caption         =   "&Rotate"
  79.          Begin VB.Menu Rotate90 
  80.             Caption         =   "&90"
  81.          End
  82.          Begin VB.Menu Rotate180 
  83.             Caption         =   "&180"
  84.          End
  85.          Begin VB.Menu Rotate270 
  86.             Caption         =   "&270"
  87.          End
  88.       End
  89.       Begin VB.Menu ColorReduce 
  90.          Caption         =   "&Color Reduction"
  91.          Begin VB.Menu OrderedDither 
  92.             Caption         =   "&Ordered"
  93.          End
  94.          Begin VB.Menu MedianCut 
  95.             Caption         =   "&Median Cut"
  96.          End
  97.          Begin VB.Menu ErrorDiffusion 
  98.             Caption         =   "&Error Diffusion"
  99.          End
  100.       End
  101.       Begin VB.Menu Sep3 
  102.          Caption         =   "-"
  103.       End
  104.       Begin VB.Menu ImageColors 
  105.          Caption         =   "&Number of Colors..."
  106.       End
  107.       Begin VB.Menu ImageWidth 
  108.          Caption         =   "&Image &Width..."
  109.       End
  110.       Begin VB.Menu ImageHeight 
  111.          Caption         =   "Image &Height..."
  112.       End
  113.    End
  114.    Begin VB.Menu Device 
  115.       Caption         =   "&Device"
  116.       Begin VB.Menu DevicePrinter 
  117.          Caption         =   "&Printer..."
  118.       End
  119.       Begin VB.Menu DeviceScreen 
  120.          Caption         =   "&Screen..."
  121.       End
  122.    End
  123.    Begin VB.Menu Help 
  124.       Caption         =   "&Help"
  125.       Begin VB.Menu HelpAbout 
  126.          Caption         =   "&About..."
  127.       End
  128.    End
  129. Attribute VB_Name = "Form1"
  130. Attribute VB_Creatable = False
  131. Attribute VB_Exposed = False
  132. Private Sub BestFit_Click()
  133.     BestFit.Checked = True
  134.     HorizontalFit.Checked = False
  135.     VerticalFit.Checked = False
  136.     OneToOne.Checked = False
  137.     Nedimage1.FitType = 0
  138. End Sub
  139. Private Sub DevicePrinter_Click()
  140.     Msg = Nedimage1.NumPrinterColors
  141.     Style = vbOKOnly
  142.     Title = "Number of default printer colors"
  143.     nok = MsgBox(Msg, Style, Title)
  144. End Sub
  145. Private Sub DeviceScreen_Click()
  146.     Msg = Nedimage1.NumScreenColors
  147.     Style = vbOKOnly
  148.     Title = "Number of screen Colors"
  149.     nok = MsgBox(Msg, Style, Title)
  150. End Sub
  151. Private Sub ErrorDiffusion_Click()
  152.     Nedimage1.ErrorDiffusionDither
  153. End Sub
  154. Private Sub FileExit_Click()
  155.     End
  156. End Sub
  157. Private Sub FileOpen_Click()
  158.     On Error GoTo Donkey:
  159.     CommonDialog1.Action = 1
  160.     Nedimage1.Picture = CommonDialog1.filename
  161.     If False = HasError(Nedimage1.GetLastError) Then
  162.         'If the screen only displays 256 colors, then
  163.         'set the color reduction method to the best type
  164.         'This is OK to do all the time since the OXC will
  165.         'not reduce the colors on an image that is not
  166.         'True Color
  167.         If 256 = Nedimage1.NumScreenColors Then
  168.             Nedimage1.MedianCutQuant
  169.         End If
  170.         Nedimage1.Refresh
  171.         PrintFile.Enabled = True
  172.     Else
  173.         PrintFile.Enabled = False
  174.     End If
  175. Donkey:
  176.     Exit Sub
  177. End Sub
  178. Private Sub Form_Resize()
  179.     Nedimage1.Width = Form1.ScaleWidth
  180.     Nedimage1.Height = Form1.ScaleHeight
  181. End Sub
  182. Private Sub HelpAbout_Click()
  183.     Nedimage1.AboutBox
  184. End Sub
  185. Private Sub HorizontalFit_Click()
  186.     BestFit.Checked = False
  187.     HorizontalFit.Checked = True
  188.     VerticalFit.Checked = False
  189.     OneToOne.Checked = False
  190.     Nedimage1.FitType = 1
  191. End Sub
  192. Private Sub ImageColors_Click()
  193.     MsgBox (Nedimage1.NumImageColors)
  194. End Sub
  195. Private Sub ImageHeight_Click()
  196.     MsgBox (Nedimage1.ImageHeight)
  197. End Sub
  198. Private Sub ImageWidth_Click()
  199.     MsgBox (Nedimage1.ImageWidth)
  200. End Sub
  201. Private Sub MedianCut_Click()
  202.     Nedimage1.MedianCutQuant
  203. End Sub
  204. Private Sub OneToOne_Click()
  205.     BestFit.Checked = False
  206.     HorizontalFit.Checked = False
  207.     VerticalFit.Checked = False
  208.     OneToOne.Checked = True
  209.     Nedimage1.FitType = 3
  210. End Sub
  211. Private Sub OrderedDither_Click()
  212.     Nedimage1.OrderedDither
  213. End Sub
  214. Private Sub PrintFile_Click()
  215.     Nedimage1.PrintImage
  216. End Sub
  217. Private Sub Rotate180_Click()
  218.     Nedimage1.Rotate180
  219. End Sub
  220. Private Sub Rotate270_Click()
  221.     Nedimage1.Rotate270
  222. End Sub
  223. Private Sub Rotate90_Click()
  224.     Nedimage1.Rotate90
  225. End Sub
  226. Private Sub VerticalFit_Click()
  227.     BestFit.Checked = False
  228.     HorizontalFit.Checked = False
  229.     VerticalFit.Checked = True
  230.     OneToOne.Checked = False
  231.     Nedimage1.FitType = 2
  232. End Sub
  233.