home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD66466112000.psc / Form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  2001-07-28  |  10.5 KB  |  352 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Banner Maker Beta 1"
  5.    ClientHeight    =   4530
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   6030
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   4530
  13.    ScaleWidth      =   6030
  14.    ShowInTaskbar   =   0   'False
  15.    StartUpPosition =   3  'Windows Default
  16.    Begin VB.CheckBox Check3 
  17.       Caption         =   "Font Underline"
  18.       Height          =   345
  19.       Left            =   4755
  20.       TabIndex        =   25
  21.       Top             =   2025
  22.       Width           =   1140
  23.    End
  24.    Begin VB.CheckBox Check2 
  25.       Caption         =   "Font Italic"
  26.       Height          =   195
  27.       Left            =   4755
  28.       TabIndex        =   24
  29.       Top             =   1755
  30.       Width           =   1005
  31.    End
  32.    Begin VB.CheckBox Check1 
  33.       Caption         =   "Font Bold"
  34.       Height          =   195
  35.       Left            =   4755
  36.       TabIndex        =   23
  37.       Top             =   1485
  38.       Width           =   1005
  39.    End
  40.    Begin VB.TextBox Text4 
  41.       Height          =   285
  42.       Left            =   1035
  43.       TabIndex        =   22
  44.       Text            =   "Banner Maker"
  45.       Top             =   2385
  46.       Width           =   3540
  47.    End
  48.    Begin VB.TextBox Text3 
  49.       Height          =   285
  50.       Left            =   4095
  51.       TabIndex        =   20
  52.       Text            =   "100"
  53.       Top             =   3045
  54.       Width           =   405
  55.    End
  56.    Begin VB.TextBox Text2 
  57.       Height          =   285
  58.       Left            =   2490
  59.       TabIndex        =   19
  60.       Text            =   "5"
  61.       Top             =   3045
  62.       Width           =   405
  63.    End
  64.    Begin VB.PictureBox Picture4 
  65.       Height          =   315
  66.       Left            =   4080
  67.       ScaleHeight     =   255
  68.       ScaleWidth      =   405
  69.       TabIndex        =   16
  70.       Top             =   1500
  71.       Width           =   465
  72.    End
  73.    Begin VB.ComboBox Combo2 
  74.       Height          =   315
  75.       Left            =   3480
  76.       TabIndex        =   15
  77.       Top             =   1920
  78.       Width           =   1095
  79.    End
  80.    Begin VB.TextBox Text1 
  81.       Height          =   285
  82.       Left            =   1020
  83.       TabIndex        =   14
  84.       Text            =   "C:\MyBanner.bmp"
  85.       Top             =   3525
  86.       Width           =   2400
  87.    End
  88.    Begin VB.CommandButton Command5 
  89.       BackColor       =   &H00E0E0E0&
  90.       Caption         =   "&About"
  91.       Height          =   350
  92.       Left            =   2970
  93.       Style           =   1  'Graphical
  94.       TabIndex        =   12
  95.       Top             =   4020
  96.       Width           =   750
  97.    End
  98.    Begin VB.CommandButton Command4 
  99.       BackColor       =   &H00E0E0E0&
  100.       Caption         =   "E&xit"
  101.       Height          =   350
  102.       Left            =   2070
  103.       Style           =   1  'Graphical
  104.       TabIndex        =   11
  105.       Top             =   4020
  106.       Width           =   870
  107.    End
  108.    Begin VB.CommandButton Command3 
  109.       BackColor       =   &H00E0E0E0&
  110.       Caption         =   "...."
  111.       Height          =   350
  112.       Left            =   1125
  113.       Style           =   1  'Graphical
  114.       TabIndex        =   10
  115.       Top             =   3045
  116.       Width           =   375
  117.    End
  118.    Begin VB.PictureBox Picture1 
  119.       AutoSize        =   -1  'True
  120.       Height          =   1020
  121.       Left            =   4815
  122.       Picture         =   "Form1.frx":0000
  123.       ScaleHeight     =   960
  124.       ScaleWidth      =   960
  125.       TabIndex        =   9
  126.       Top             =   3210
  127.       Visible         =   0   'False
  128.       Width           =   1020
  129.    End
  130.    Begin VB.ComboBox Combo1 
  131.       Height          =   315
  132.       Left            =   1020
  133.       TabIndex        =   6
  134.       Top             =   1920
  135.       Width           =   1620
  136.    End
  137.    Begin VB.PictureBox Picture3 
  138.       AutoSize        =   -1  'True
  139.       BackColor       =   &H00C0C0C0&
  140.       Height          =   315
  141.       Left            =   1005
  142.       Picture         =   "Form1.frx":3042
  143.       ScaleHeight     =   255
  144.       ScaleWidth      =   3000
  145.       TabIndex        =   3
  146.       Top             =   1500
  147.       Width           =   3060
  148.    End
  149.    Begin VB.PictureBox Picture2 
  150.       AutoRedraw      =   -1  'True
  151.       Height          =   915
  152.       Left            =   75
  153.       ScaleHeight     =   855
  154.       ScaleWidth      =   5790
  155.       TabIndex        =   2
  156.       Top             =   150
  157.       Width           =   5850
  158.    End
  159.    Begin VB.CommandButton Command2 
  160.       BackColor       =   &H00E0E0E0&
  161.       Caption         =   "&Save"
  162.       Height          =   350
  163.       Left            =   1125
  164.       Style           =   1  'Graphical
  165.       TabIndex        =   1
  166.       Top             =   4020
  167.       Width           =   915
  168.    End
  169.    Begin VB.CommandButton Command1 
  170.       BackColor       =   &H00E0E0E0&
  171.       Caption         =   "Make"
  172.       Height          =   350
  173.       Left            =   150
  174.       Style           =   1  'Graphical
  175.       TabIndex        =   0
  176.       Top             =   4020
  177.       Width           =   945
  178.    End
  179.    Begin VB.Label Label1 
  180.       AutoSize        =   -1  'True
  181.       Caption         =   "Banner Title"
  182.       Height          =   195
  183.       Index           =   7
  184.       Left            =   120
  185.       TabIndex        =   21
  186.       Top             =   2445
  187.       Width           =   855
  188.    End
  189.    Begin VB.Label Label1 
  190.       AutoSize        =   -1  'True
  191.       Caption         =   "Title Alignment"
  192.       Height          =   195
  193.       Index           =   6
  194.       Left            =   3000
  195.       TabIndex        =   18
  196.       Top             =   3105
  197.       Width           =   1035
  198.    End
  199.    Begin VB.Label Label1 
  200.       AutoSize        =   -1  'True
  201.       Caption         =   "Title Top"
  202.       Height          =   195
  203.       Index           =   5
  204.       Left            =   1785
  205.       TabIndex        =   17
  206.       Top             =   3105
  207.       Width           =   630
  208.    End
  209.    Begin VB.Label Label1 
  210.       Caption         =   "Save image"
  211.       Height          =   195
  212.       Index           =   4
  213.       Left            =   120
  214.       TabIndex        =   13
  215.       Top             =   3570
  216.       Width           =   840
  217.    End
  218.    Begin VB.Label Label1 
  219.       AutoSize        =   -1  'True
  220.       Caption         =   "BackGround"
  221.       Height          =   195
  222.       Index           =   3
  223.       Left            =   120
  224.       TabIndex        =   8
  225.       Top             =   3105
  226.       Width           =   900
  227.    End
  228.    Begin VB.Line Line1 
  229.       BorderColor     =   &H00FFFFFF&
  230.       Index           =   1
  231.       X1              =   30
  232.       X2              =   1260
  233.       Y1              =   2790
  234.       Y2              =   2790
  235.    End
  236.    Begin VB.Line Line1 
  237.       BorderColor     =   &H00808080&
  238.       Index           =   0
  239.       X1              =   30
  240.       X2              =   1260
  241.       Y1              =   2775
  242.       Y2              =   2775
  243.    End
  244.    Begin VB.Label Label1 
  245.       AutoSize        =   -1  'True
  246.       Caption         =   "Font Size"
  247.       Height          =   195
  248.       Index           =   2
  249.       Left            =   2745
  250.       TabIndex        =   7
  251.       Top             =   1995
  252.       Width           =   660
  253.    End
  254.    Begin VB.Label Label1 
  255.       AutoSize        =   -1  'True
  256.       Caption         =   "Font Name"
  257.       Height          =   195
  258.       Index           =   1
  259.       Left            =   120
  260.       TabIndex        =   5
  261.       Top             =   1995
  262.       Width           =   780
  263.    End
  264.    Begin VB.Label Label1 
  265.       AutoSize        =   -1  'True
  266.       Caption         =   "Font Colour"
  267.       Height          =   195
  268.       Index           =   0
  269.       Left            =   120
  270.       TabIndex        =   4
  271.       Top             =   1545
  272.       Width           =   810
  273.    End
  274. Attribute VB_Name = "Form1"
  275. Attribute VB_GlobalNameSpace = False
  276. Attribute VB_Creatable = False
  277. Attribute VB_PredeclaredId = True
  278. Attribute VB_Exposed = False
  279. Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
  280. Sub CenterForm(Frm As Form)
  281. With Frm
  282.     .Top = (Screen.Height - .Height) / 2
  283.     .Left = (Screen.Width - .Width) / 2
  284. End With
  285. End Sub
  286. Sub MakeBanner(Xpos, YPos As Integer, Title, TitleFont As String, TextSize As Integer, bsBold, bsItalic, bsUnLine, TextColour As Long)
  287. Dim X, Y, I, J As Single
  288.     I = Picture1.ScaleWidth
  289.     J = Picture1.ScaleHeight
  290.     Y = 0
  291.     Do While Y < Picture2.ScaleHeight
  292.         X = 0
  293.         Do While X < Picture2.ScaleWidth
  294.             Picture2.PaintPicture Picture1.Picture, X, Y, I, J
  295.             Picture2.FontName = TitleFont
  296.             Picture2.FontBold = bsBold
  297.             Picture2.FontItalic = bsItalic
  298.             Picture2.FontUnderline = bsUnLine
  299.             Picture2.ForeColor = TextColour
  300.             Picture2.FontSize = TextSize
  301.             TextOut Picture2.hdc, Xpos, YPos, Title, Len(Title)
  302.             X = X + I
  303.         Loop
  304.         Y = Y + J
  305.     Loop
  306. End Sub
  307. Private Sub Command1_Click()
  308. MakeBanner Val(Text3), Val(Text2), Text4, Combo1.Text, Val(Combo2), _
  309. Check1.Value, Check2.Value, Check3.Value, Picture4.BackColor
  310. End Sub
  311. Private Sub Command2_Click()
  312. SavePicture Picture2.Image, Text1.Text
  313.  MsgBox "Your Banner have been saved to " & Text1.Text
  314. End Sub
  315. Private Sub Command3_Click()
  316. Form2.Show
  317.  Form1.Hide
  318. End Sub
  319. Private Sub Command4_Click()
  320. MsgBox "More of my projects at http://www.codearchive.com/~dreamvb/": End
  321. End Sub
  322. Private Sub Command5_Click()
  323.  MsgBox "Banner Maker by Ben Jones Please Vote if you like it", vbInformation
  324. End Sub
  325. Private Sub Form_Load()
  326. CenterForm Form1
  327.   For I = 1 To Screen.FontCount - 1
  328.    Combo1.AddItem Screen.Fonts(I)
  329.     Next
  330.  For J = 10 To 40 Step 2
  331.     Combo2.AddItem J
  332.  Next
  333.  Combo1.ListIndex = 4
  334.  Combo2.ListIndex = 8
  335.  Picture4.BackColor = vbRed
  336. End Sub
  337. Private Sub Form_Resize()
  338.  Line1(0).X2 = Me.Width
  339.  Line1(1).X2 = Me.Width
  340. End Sub
  341. Private Sub Picture3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  342. Dim MSG
  343. On Error Resume Next
  344.  If Button = 1 Then
  345.     Picture4.BackColor = Picture3.Point(X, Y)
  346.  If Err Then Err.Clear
  347.  End If
  348. End Sub
  349. Private Sub Picture5_Click()
  350. Picture1.Picture = Picture5.Picture
  351. End Sub
  352.