VB 2008 Tutorial - GDI+ Text Animation
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
6 posts
Page 1 of 1
Hi, Now i will explain shortly about GDI+, GDI+ is the way of creating any graphics like Text or objects using GDI+ way of coding
Now i gonna show you how to make exclusive GDI+ Text Animation with these simple codes
You can also change Text Font, Size, Where to display and Draw Location in codes
Insert 1 Timer and 1 PictureBox, Note: I used PictureBox to display the GDI+ Text Animation
And i used Timer as main control to draw GDI+ Text Animation
Okay then now make PictureBox size too larger to display the GDI+ Text Animation, Note: You can adjust the Text Font, Font Size, Where to Draw, Draw Location and Color in the Timer`s code
Now first add these Imports top of the Public Class Form1
Figure 1 Screenshot [Screenshot of GDI+ Text Animation after debugging]
![Image]()
*******************Thanks for reading my tutorial, I think this Tutorial will be most helpful to you!*******************
If you want any custom tutorial for you or you need any help in VS.NET, VB.NET, Software Coding, Designing and much more any help in Computer stuffs just ask me
Mostly i will help everyone in coding and design stuffs in on Computer
- Best regards hehaho;
- Tvs Praveen wahooo;
- Thanks CodeNStuff! for this amazing Website cooll;
Now i gonna show you how to make exclusive GDI+ Text Animation with these simple codes
You can also change Text Font, Size, Where to display and Draw Location in codes
Insert 1 Timer and 1 PictureBox, Note: I used PictureBox to display the GDI+ Text Animation
And i used Timer as main control to draw GDI+ Text Animation
Okay then now make PictureBox size too larger to display the GDI+ Text Animation, Note: You can adjust the Text Font, Font Size, Where to Draw, Draw Location and Color in the Timer`s code
Now first add these Imports top of the Public Class Form1
Code: Select all
Then insert this below Public Class Form1Imports System.Drawing.Drawing2D
Imports System.Drawing.Text
Code: Select all
Now double click Timer and insert this code into itConst TextTimerInterval As Integer = 15 ' In milliseconds
Protected currentGradientShift As Integer = 10
Protected gradiantStep As Integer = 5
Code: Select all
After you done everything in the coding then debug, You get your 3D GDI+ Text Animation! wahooo; Dim grfx As Graphics = PictureBox1.CreateGraphics()
' Set the font type, text, and determine its size.
Dim font As New Font("Microsoft Sans Serif", 66, _
FontStyle.Bold, GraphicsUnit.Point)
Dim strText As String = "Tvs Praveen"
Dim sizfText As New SizeF(grfx.MeasureString(strText, font))
' Set the point at which the text will be drawn: centered
' in the client area.
Dim ptfTextStart As New PointF( _
CSng(ClientSize.Width - sizfText.Width) / 2, _
CSng(ClientSize.Height - sizfText.Height) / 2)
' Set the gradient start and end point, the latter being adjusted
' by a changing value to give the animation affect.
Dim ptfGradientStart As New PointF(0, 0)
Dim ptfGradientEnd As New PointF(currentGradientShift, 200)
' Instantiate the brush used for drawing the text.
Dim grBrush As New LinearGradientBrush(ptfGradientStart, _
ptfGradientEnd, Color.Red, BackColor)
' Draw the text centered on the client area.
grfx.DrawString(strText, font, grBrush, ptfTextStart)
grfx.Dispose()
' Shift the gradient, reversing it when it gets to a certain value.
currentGradientShift += gradiantStep
If currentGradientShift = 500 Then
gradiantStep = -5
ElseIf currentGradientShift = -50 Then
gradiantStep = 5
End If
Figure 1 Screenshot [Screenshot of GDI+ Text Animation after debugging]

*******************Thanks for reading my tutorial, I think this Tutorial will be most helpful to you!*******************
If you want any custom tutorial for you or you need any help in VS.NET, VB.NET, Software Coding, Designing and much more any help in Computer stuffs just ask me
Mostly i will help everyone in coding and design stuffs in on Computer
- Best regards hehaho;
- Tvs Praveen wahooo;
- Thanks CodeNStuff! for this amazing Website cooll;
Last edited by tvs praveen on Sat Jan 23, 2010 5:59 am, edited 1 time in total.
GDI is more powerful then I thought... Seriously you'll have success by posting GDI tutorials.
6 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023