home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / wmfbmp / wmf2bmp.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1992-12-03  |  7.1 KB  |  245 lines

  1. VERSION 2.00
  2. Begin Form WMF2BMP 
  3.    Caption         =   "WMF2BMP"
  4.    Height          =   6210
  5.    Icon            =   WMF2BMP.FRX:0000
  6.    Left            =   255
  7.    LinkTopic       =   "Form1"
  8.    ScaleHeight     =   368
  9.    ScaleMode       =   3  'Pixel
  10.    ScaleWidth      =   599
  11.    Top             =   885
  12.    Width           =   9105
  13.    Begin CommandButton Command6 
  14.       Caption         =   "Revert"
  15.       Height          =   315
  16.       Left            =   120
  17.       TabIndex        =   12
  18.       Top             =   1320
  19.       Width           =   855
  20.    End
  21.    Begin HScrollBar HScroll1 
  22.       Height          =   315
  23.       LargeChange     =   50
  24.       Left            =   120
  25.       Max             =   1024
  26.       Min             =   32
  27.       SmallChange     =   5
  28.       TabIndex        =   8
  29.       Top             =   3540
  30.       Value           =   32
  31.       Width           =   855
  32.    End
  33.    Begin CommandButton Command5 
  34.       Caption         =   "Clear"
  35.       Height          =   315
  36.       Left            =   120
  37.       TabIndex        =   7
  38.       Top             =   2160
  39.       Width           =   855
  40.    End
  41.    Begin CommandButton Command4 
  42.       Caption         =   "Load"
  43.       Height          =   315
  44.       Left            =   120
  45.       TabIndex        =   6
  46.       Top             =   480
  47.       Width           =   855
  48.    End
  49.    Begin CommandButton Command3 
  50.       Caption         =   "Exit"
  51.       Height          =   315
  52.       Left            =   120
  53.       TabIndex        =   5
  54.       Top             =   2580
  55.       Width           =   855
  56.    End
  57.    Begin CommandButton Command2 
  58.       Caption         =   "Save"
  59.       Height          =   315
  60.       Left            =   120
  61.       TabIndex        =   4
  62.       Top             =   1740
  63.       Width           =   855
  64.    End
  65.    Begin CommandButton Command1 
  66.       Caption         =   "Convert"
  67.       Enabled         =   0   'False
  68.       Height          =   315
  69.       Left            =   120
  70.       TabIndex        =   3
  71.       Top             =   900
  72.       Width           =   855
  73.    End
  74.    Begin PictureBox Picture2 
  75.       AutoSize        =   -1  'True
  76.       Height          =   2115
  77.       Left            =   5040
  78.       ScaleHeight     =   139
  79.       ScaleMode       =   3  'Pixel
  80.       ScaleWidth      =   255
  81.       TabIndex        =   2
  82.       Top             =   480
  83.       Width           =   3855
  84.    End
  85.    Begin PictureBox Picture1 
  86.       AutoRedraw      =   -1  'True
  87.       AutoSize        =   -1  'True
  88.       Height          =   2115
  89.       Left            =   1080
  90.       ScaleHeight     =   139
  91.       ScaleMode       =   3  'Pixel
  92.       ScaleWidth      =   239
  93.       TabIndex        =   0
  94.       Top             =   480
  95.       Width           =   3615
  96.    End
  97.    Begin Label Label2 
  98.       Height          =   255
  99.       Left            =   120
  100.       TabIndex        =   11
  101.       Top             =   4320
  102.       Width           =   855
  103.    End
  104.    Begin Label Label4 
  105.       Caption         =   "Scale"
  106.       Height          =   255
  107.       Left            =   120
  108.       TabIndex        =   10
  109.       Top             =   3240
  110.       Width           =   615
  111.    End
  112.    Begin Label Label3 
  113.       Height          =   255
  114.       Left            =   120
  115.       TabIndex        =   9
  116.       Top             =   4020
  117.       Width           =   855
  118.    End
  119.    Begin Label Label1 
  120.       AutoSize        =   -1  'True
  121.       Caption         =   "WMF Image"
  122.       Height          =   195
  123.       Left            =   1080
  124.       TabIndex        =   1
  125.       Top             =   180
  126.       Width           =   1020
  127.    End
  128.    Begin Menu filemen 
  129.       Caption         =   "&File"
  130.       Begin Menu exitmen 
  131.          Caption         =   "E&xit"
  132.       End
  133.    End
  134.    Begin Menu aboutmen 
  135.       Caption         =   "&About"
  136.       Begin Menu proginfomen 
  137.          Caption         =   "&About WMF2BMP"
  138.       End
  139.       Begin Menu ososoftmen 
  140.          Caption         =   "&Other OsoSoft Programs"
  141.       End
  142.    End
  143. '* Be sure to check the properties of all controls,
  144. 'since they are not set in code, but are very important.
  145. 'Especially check the properties of picture controls!
  146. Dim theratio As Single
  147. Dim oldwidth As Integer
  148. Sub command1_click ()
  149. screen.MousePointer = 11
  150. label1.Caption = "PCX Image"
  151. picture1.Visible = 0
  152. picture2.Left = picture1.Left
  153. picture2.Top = picture1.Top
  154. picture2.Visible = -1
  155. picture2.Picture = picture1.Image
  156. command2.Enabled = True
  157. hscroll1.Enabled = 0
  158. screen.MousePointer = 0
  159. End Sub
  160. Sub command2_click ()
  161. If picture2.Visible = 0 Then Exit Sub
  162. newfile$ = UCase$(Left$(thefile$, InStr(thefile$, "."))) + "BMP"
  163. fileroot$ = InputBox("Enter Filename.", "WMF2BMP", newfile$)
  164. If InStr(fileroot$, ".") = 0 Then
  165.     If Len(fileroot$) < 9 Then wholename$ = fileroot$ + ".BMP"
  166.     Else wholename$ = fileroot$
  167. End If
  168. If InStr(wholename$, "\") = 0 Then wholename$ = thepath$ + wholename$
  169. On Error GoTo badfile
  170. SavePicture picture2, wholename$
  171. GoTo getout
  172. badfile:
  173. msg$ = "Invalid filename. File not saved."
  174. MsgBox msg$
  175. Resume getout
  176. getout:
  177. End Sub
  178. Sub Command3_Click ()
  179. End Sub
  180. Sub Command4_Click ()
  181. getfile.Show 1
  182. If thefile$ = "" Then Exit Sub
  183. command2.Enabled = False
  184. picture2.Visible = False
  185. picture1.Visible = True
  186. label1.Caption = "WMF Image"
  187. picture1.Picture = LoadPicture(thefile$)
  188. label3.Caption = Str$(picture1.Width) + "W"
  189. label2.Caption = Str$(picture1.Height) + "H"
  190. theratio = picture1.Width / picture1.Height
  191. oldwidth = picture1.Width
  192. hscroll1.Value = picture1.Width
  193. command1.Enabled = -1
  194. End Sub
  195. Sub Command5_Click ()
  196. picture1.Picture = LoadPicture("")
  197. picture2.Picture = LoadPicture("")
  198. picture1.Visible = -1
  199. picture2.Visible = -1
  200. label1.Caption = "WMF"
  201. End Sub
  202. Sub Command6_Click ()
  203. picture1.Visible = -1
  204. picture1.Picture = LoadPicture("")
  205. picture1.Picture = LoadPicture(thefile$)
  206. picture2.Picture = LoadPicture("")
  207. picture2.Visible = 0
  208. hscroll1.Enabled = -1
  209. hscroll1.Value = oldwidth
  210. label1.Caption = "WMF Image"
  211. command2.Enabled = 0
  212. End Sub
  213. Sub Exitmen_Click ()
  214. End Sub
  215. Sub Form_Load ()
  216. picture2.Visible = 0
  217. command2.Enabled = False
  218. End Sub
  219. Sub Form_Unload (Cancel As Integer)
  220. Unload orderform
  221. Unload getfile
  222. End Sub
  223. Sub HScroll1_Change ()
  224. picture1.Width = hscroll1.Value
  225. picture1.Height = Int(picture1.Width / theratio)
  226. hcaption = Str$(picture1.Width) + "W"
  227. vcaption = Str$(picture1.Height) + "H"
  228. label3.Caption = hcaption
  229. label2.Caption = vcaption
  230. End Sub
  231. Sub ososoftmen_Click ()
  232. orderform.Show 1
  233. End Sub
  234. Sub proginfomen_Click ()
  235. nl$ = Chr$(13) + Chr$(10)
  236. msg$ = "WMF2BMP is a Free program from OsoSoft, but is Copyright, 1992, by OsoSoft and George Campbell. All Rights Reserved."
  237. msg$ = msg$ + " You may use this program freely, but must distribute it only in an unaltered form, complete with WMF2BMP.WRI."
  238. msg$ = msg$ + " You may not distribute this program as part of any commercially distributed program without written permission."
  239. msg$ = msg$ + nl$ + nl$ + "OsoSoft"
  240. msg$ = msg$ + nl$ + "1472 Sixth Street"
  241. msg$ = msg$ + nl$ + "Los Osos, CA  93402"
  242. msg$ = msg$ + nl$ + "OsoSoft BBS: (805) 528-3753, 300-2400, 8N1"
  243. MsgBox msg$
  244. End Sub
  245.