home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Picture_Te20249310142006.psc / Text+Pic / Form1.frm next >
Text File  |  2006-10-14  |  9KB  |  326 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
  3. Begin VB.Form Form1 
  4.    BackColor       =   &H80000018&
  5.    Caption         =   "  Text+Picture ::.."
  6.    ClientHeight    =   6060
  7.    ClientLeft      =   60
  8.    ClientTop       =   450
  9.    ClientWidth     =   8220
  10.    Icon            =   "Form1.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   6060
  13.    ScaleWidth      =   8220
  14.    StartUpPosition =   3  'Windows Default
  15.    Begin VB.CommandButton Command10 
  16.       Caption         =   "Fit"
  17.       Height          =   315
  18.       Left            =   1680
  19.       TabIndex        =   17
  20.       Top             =   1200
  21.       Width           =   1455
  22.    End
  23.    Begin VB.CommandButton Command9 
  24.       Caption         =   "AutoSize"
  25.       Height          =   315
  26.       Left            =   120
  27.       TabIndex        =   16
  28.       Top             =   1200
  29.       Width           =   1455
  30.    End
  31.    Begin VB.CommandButton Command8 
  32.       Caption         =   "Font"
  33.       Height          =   255
  34.       Left            =   6600
  35.       TabIndex        =   15
  36.       Top             =   600
  37.       Width           =   615
  38.    End
  39.    Begin VB.CommandButton Command7 
  40.       Caption         =   "File"
  41.       Height          =   255
  42.       Left            =   6000
  43.       TabIndex        =   14
  44.       Top             =   240
  45.       Width           =   1215
  46.    End
  47.    Begin VB.TextBox Text2 
  48.       Height          =   285
  49.       Left            =   3360
  50.       TabIndex        =   12
  51.       Top             =   240
  52.       Width           =   2535
  53.    End
  54.    Begin VB.CommandButton Command6 
  55.       Caption         =   "Clear"
  56.       Height          =   255
  57.       Left            =   3000
  58.       TabIndex        =   11
  59.       Top             =   600
  60.       Width           =   615
  61.    End
  62.    Begin VB.CommandButton Command5 
  63.       Caption         =   "R"
  64.       Height          =   255
  65.       Left            =   5880
  66.       TabIndex        =   10
  67.       Top             =   600
  68.       Width           =   615
  69.    End
  70.    Begin VB.CommandButton Command4 
  71.       Caption         =   "I"
  72.       BeginProperty Font 
  73.          Name            =   "MS Sans Serif"
  74.          Size            =   8.25
  75.          Charset         =   0
  76.          Weight          =   400
  77.          Underline       =   0   'False
  78.          Italic          =   -1  'True
  79.          Strikethrough   =   0   'False
  80.       EndProperty
  81.       Height          =   255
  82.       Left            =   5160
  83.       TabIndex        =   9
  84.       Top             =   600
  85.       Width           =   615
  86.    End
  87.    Begin VB.CommandButton Command3 
  88.       Caption         =   "B"
  89.       BeginProperty Font 
  90.          Name            =   "MS Sans Serif"
  91.          Size            =   8.25
  92.          Charset         =   0
  93.          Weight          =   700
  94.          Underline       =   0   'False
  95.          Italic          =   0   'False
  96.          Strikethrough   =   0   'False
  97.       EndProperty
  98.       Height          =   255
  99.       Left            =   4440
  100.       TabIndex        =   8
  101.       Top             =   600
  102.       Width           =   615
  103.    End
  104.    Begin VB.TextBox Text3 
  105.       Height          =   285
  106.       Left            =   1080
  107.       TabIndex        =   7
  108.       Top             =   600
  109.       Width           =   975
  110.    End
  111.    Begin VB.CommandButton Command2 
  112.       Caption         =   "Color"
  113.       Height          =   255
  114.       Left            =   3720
  115.       TabIndex        =   5
  116.       Top             =   600
  117.       Width           =   615
  118.    End
  119.    Begin MSComDlg.CommonDialog cmg 
  120.       Left            =   960
  121.       Top             =   2040
  122.       _ExtentX        =   847
  123.       _ExtentY        =   847
  124.       _Version        =   393216
  125.    End
  126.    Begin VB.CommandButton Command1 
  127.       Caption         =   "Save"
  128.       Height          =   255
  129.       Left            =   2280
  130.       TabIndex        =   4
  131.       Top             =   600
  132.       Width           =   615
  133.    End
  134.    Begin VB.TextBox Text1 
  135.       Height          =   285
  136.       Left            =   1080
  137.       TabIndex        =   2
  138.       Top             =   240
  139.       Width           =   1695
  140.    End
  141.    Begin VB.PictureBox pic 
  142.       Appearance      =   0  'Flat
  143.       AutoRedraw      =   -1  'True
  144.       AutoSize        =   -1  'True
  145.       BackColor       =   &H80000005&
  146.       ForeColor       =   &H80000008&
  147.       Height          =   3690
  148.       Left            =   120
  149.       Picture         =   "Form1.frx":15162
  150.       ScaleHeight     =   3660
  151.       ScaleWidth      =   7095
  152.       TabIndex        =   0
  153.       Top             =   1560
  154.       Width           =   7125
  155.       Begin VB.Label Label1 
  156.          AutoSize        =   -1  'True
  157.          BackStyle       =   0  'Transparent
  158.          Caption         =   "Put The text where you want."
  159.          BeginProperty Font 
  160.             Name            =   "MS Sans Serif"
  161.             Size            =   9.75
  162.             Charset         =   0
  163.             Weight          =   700
  164.             Underline       =   0   'False
  165.             Italic          =   0   'False
  166.             Strikethrough   =   0   'False
  167.          EndProperty
  168.          Height          =   240
  169.          Left            =   3960
  170.          TabIndex        =   1
  171.          Top             =   3120
  172.          Width           =   2925
  173.       End
  174.    End
  175.    Begin VB.Label Label3 
  176.       AutoSize        =   -1  'True
  177.       BackStyle       =   0  'Transparent
  178.       Caption         =   "File:"
  179.       Height          =   195
  180.       Left            =   3000
  181.       TabIndex        =   13
  182.       Top             =   240
  183.       Width           =   285
  184.    End
  185.    Begin VB.Label Label4 
  186.       AutoSize        =   -1  'True
  187.       BackStyle       =   0  'Transparent
  188.       Caption         =   "Font Size:"
  189.       Height          =   195
  190.       Left            =   120
  191.       TabIndex        =   6
  192.       Top             =   600
  193.       Width           =   705
  194.    End
  195.    Begin VB.Label Label2 
  196.       AutoSize        =   -1  'True
  197.       BackStyle       =   0  'Transparent
  198.       Caption         =   "Text to print:"
  199.       Height          =   195
  200.       Left            =   120
  201.       TabIndex        =   3
  202.       Top             =   240
  203.       Width           =   885
  204.    End
  205. End
  206. Attribute VB_Name = "Form1"
  207. Attribute VB_GlobalNameSpace = False
  208. Attribute VB_Creatable = False
  209. Attribute VB_PredeclaredId = True
  210. Attribute VB_Exposed = False
  211. Dim sc As Long 'scale
  212. Dim MoveReady As Boolean
  213.  
  214.  
  215. Private Sub Command1_Click()
  216. savePic
  217. End Sub
  218.  
  219. Private Sub Command10_Click()
  220. pic.AutoSize = False
  221. rez
  222. End Sub
  223.  
  224. Private Sub Command2_Click()
  225. cmg.ShowColor
  226. Label1.ForeColor = cmg.Color
  227. End Sub
  228. Private Sub Command3_Click()
  229. Label1.FontBold = True
  230. End Sub
  231. Private Sub Command4_Click()
  232. Label1.FontItalic = True
  233. End Sub
  234. Private Sub Command5_Click()
  235. Label1.FontBold = False
  236. Label1.FontItalic = False
  237. End Sub
  238. Private Sub Command6_Click()
  239. pic.Cls
  240. End Sub
  241. Private Sub Command7_Click()
  242. On Error GoTo 1
  243. cmg.ShowOpen
  244. If cmg.FileName <> "" Then
  245.    pic.Cls
  246.    pic = LoadPicture(cmg.FileName)
  247.    Text2 = cmg.FileName
  248. End If
  249. 1: If Error(Err.Number) <> "" Then
  250.       MsgBox Error(Err.Number)
  251.    End If
  252. End Sub
  253.  
  254.  
  255. Private Sub Command8_Click()
  256. 'on my computer i recive an error that there is no font setup.what about you?
  257. On Error GoTo 1
  258.    cmg.ShowFont
  259.    If cmg.FontName <> "" Then
  260.       Label1.Font = cmg.FontName
  261.    End If
  262. 1: If Error(Err.Number) <> "" Then
  263.       MsgBox Error(Err.Number)
  264.    End If
  265. End Sub
  266.  
  267. Private Sub Command9_Click()
  268. pic.AutoSize = True
  269. rez
  270. End Sub
  271.  
  272. Private Sub Form_Load()
  273. MoveReady = False
  274. End Sub
  275.  
  276. Private Sub Form_Resize()
  277.  
  278. pic.Width = Me.Width - 1200
  279. pic.Height = Me.Height - 3000
  280. rez
  281. End Sub
  282.  
  283. Private Sub pic_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  284. MoveReady = True
  285. End Sub
  286.  
  287. Private Sub pic_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  288. If MoveReady = True Then
  289. Label1.Left = X
  290. Label1.Top = Y
  291. DoEvents
  292. End If
  293. End Sub
  294.  
  295. Private Sub pic_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  296.  
  297. MoveReady = False
  298. End Sub
  299.  
  300. Private Sub Text1_Change()
  301. Label1 = Text1
  302. End Sub
  303. Private Sub savePic()
  304. pic.CurrentY = Label1.Top
  305. pic.CurrentX = Label1.Left
  306. pic.FontBold = Label1.FontBold
  307. pic.FontItalic = Label1.FontItalic
  308. pic.FontSize = Label1.FontSize
  309. pic.ForeColor = Label1.ForeColor
  310. pic.Font = Label1.Font
  311. pic.Print Label1
  312. SavePicture pic.Image, "c:\test.bmp"
  313. End Sub
  314.  
  315. Private Sub Text3_Change()
  316. On Error Resume Next
  317. Label1.FontSize = Text3
  318. End Sub
  319. Private Sub rez()
  320. Dim picW, picH As Long
  321. picW = pic.Width
  322. picH = pic.Height
  323. pic.Cls
  324. pic.PaintPicture pic.Picture, 0, 0, picW, picH, 0, 0
  325. End Sub
  326.