Font 3D : Font « 2D Graphics « VB.Net Tutorial

Home
VB.Net Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statements
5.Date Time
6.Class Module
7.Development
8.Collections
9.Generics
10.Attributes
11.Event
12.LINQ
13.Stream File
14.GUI
15.GUI Applications
16.Windows Presentation Foundation
17.2D Graphics
18.I18N Internationlization
19.Reflection
20.Regular Expressions
21.Security
22.Socket Network
23.Thread
24.Windows
25.XML
26.Database ADO.net
27.Design Patterns
VB.Net
VB.Net by API
VB.Net Tutorial » 2D Graphics » Font 
17.36.8.Font 3D
Font 3D
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms

public class Font3D
   public Shared Sub Main
        Application.Run(New Form1)
   End Sub
End class

Public Class Form1
    Inherits System.Windows.Forms.Form

    Public Sub New()
        MyBase.New()

        InitializeComponent()

    End Sub

    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is NothingThen
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    Private components As System.ComponentModel.IContainer

    Friend WithEvents TrackBar1 As System.Windows.Forms.TrackBar
    Friend WithEvents Panel1 As System.Windows.Forms.Panel
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Button3 As System.Windows.Forms.Button
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents Button4 As System.Windows.Forms.Button
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
    Friend WithEvents Button5 As System.Windows.Forms.Button
    Friend WithEvents ColorDialog1 As System.Windows.Forms.ColorDialog
    Friend WithEvents FontDialog1 As System.Windows.Forms.FontDialog
    <System.Diagnostics.DebuggerStepThrough()Private Sub InitializeComponent()
        Me.TrackBar1 = New System.Windows.Forms.TrackBar
        Me.Panel1 = New System.Windows.Forms.Panel
        Me.Button1 = New System.Windows.Forms.Button
        Me.Button3 = New System.Windows.Forms.Button
        Me.Button2 = New System.Windows.Forms.Button
        Me.Button4 = New System.Windows.Forms.Button
        Me.TextBox1 = New System.Windows.Forms.TextBox
        Me.Button5 = New System.Windows.Forms.Button
        Me.ColorDialog1 = New System.Windows.Forms.ColorDialog
        Me.FontDialog1 = New System.Windows.Forms.FontDialog
        CType(Me.TrackBar1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'TrackBar1
        '
        Me.TrackBar1.Location = New System.Drawing.Point(48208)
        Me.TrackBar1.Maximum = 20
        Me.TrackBar1.Name = "TrackBar1"
        Me.TrackBar1.Size = New System.Drawing.Size(21645)
        Me.TrackBar1.TabIndex = 1
        '
        'Panel1
        '
        Me.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.Panel1.Location = New System.Drawing.Point(1616)
        Me.Panel1.Name = "Panel1"
        Me.Panel1.Size = New System.Drawing.Size(256112)
        Me.Panel1.TabIndex = 2
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(513)
        Me.ClientSize = New System.Drawing.Size(392266)
        Me.Controls.Add(Me.Panel1)
        Me.Controls.Add(Me.TrackBar1)
        CType(Me.TrackBar1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

    

    Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgsHandles TrackBar1.Scroll
        Dim color1, color2 As Color
        Dim TrackbarPos1, TrackbarPos2

        color1 = Color.Green
        color2 = Color.Black
        TrackbarPos1 = 0

        Dim As Graphics = Panel1.CreateGraphics
        Dim As New SolidBrush(color1)
        Dim As New SolidBrush(color2)
        Dim As New SolidBrush(Me.BackColor)
        Dim As Integer

        a.FillRectangle(d, ClientRectangle)
        For k = TrackBar1.Value To Step -1
            a.DrawString("3D Font", FontDialog1.Font, c, 20 + k, 20 - k)
        Next
        a.DrawString("3D Font", FontDialog1.Font, b, 2020)
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgsHandles MyBase.Load
    End Sub

End Class
17.36.Font
17.36.1.Create Font with font name, size and styleCreate Font with font name, size and style
17.36.2.Create Font from FontCreate Font from Font
17.36.3.Set font name, size and styleSet font name, size and style
17.36.4.Font Size
17.36.5.Get Font informationGet Font information
17.36.6.Displaying font metric informationDisplaying font metric information
17.36.7.Use CheckBox to Set FontUse CheckBox to Set Font
17.36.8.Font 3DFont 3D
17.36.9.CellAscent, Descent, EmHeight, LineSpacingCellAscent, Descent, EmHeight, LineSpacing
17.36.10.Use RadioButton to control fontUse RadioButton to control font
17.36.11.Use CheckBox to control fontUse CheckBox to control font
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.