VB 2008 Tutorial - GDI+ Gradient Colored Text Effect

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.
16 posts Page 1 of 2
Contributors
User avatar
tvs praveen
Top Poster
Top Poster
Posts: 205
Joined: Tue Dec 08, 2009 6:20 am

Hi, Now i`m gonna show how to paint GDI+ Gradient Colored Text Effect in VB.NET, I made this tutorial too simple which first time users of VB.NET also can understand this tutorial!

Now add 1 PictureBox

Note: PictureBox is using to paint

Then add this Imports above Public Class Form1
Code: Select all
Imports System.Drawing.Drawing2D
Then add this code into PictureBox`s Paint in Events
Code: Select all
        Dim txt = "Tvs" & vbCrLf & "Praveen"
        Dim font_size As Single = 64
        Dim text_path As New GraphicsPath()
        Dim font_family As New FontFamily("Comic Sans MS")
        ' Add text to the path.
        text_path.AddString(txt, _
              font_family, _
       System.Drawing.FontStyle.Bold, _
              font_size, _
              New PointF(5, 5), _
             System.Drawing.StringFormat.GenericDefault)
        ' Get the text's width and height.
        Dim txt_size As SizeF = _
            e.Graphics.MeasureString(txt, _
                New Font(font_family, _
                    font_size, _
                    FontStyle.Bold, _
                    GraphicsUnit.Pixel))
        ' Fill the path with a gradient.
        e.Graphics.FillPath( _
            New System.Drawing.Drawing2D.LinearGradientBrush( _
                New Point(5, 5), _
                New Point(5 + txt_size.Width, 5 + txt_size.Height), _
                Color.Red, _
                Color.Yellow), _
            text_path)
        ' Outline the path.
        e.Graphics.DrawPath(Pens.DarkBlue, text_path)
    End Sub
Now debug, Here your`s GDI+ Gradient Colored Text Effect is ready to use!

You can change text, font styles, size, location and sizes in code Paint in Events of PictureBox

Figure 1 [Screenshot of Gradient Colored Text Effect]

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;
User avatar
Usman55
VIP - Site Partner
VIP - Site Partner
Posts: 2821
Joined: Thu Dec 24, 2009 7:52 pm

That is just awesome! When did you learn GDI+?
Image
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

HAVE YOU gotten this off a forum or something?
Image
User avatar
tvs praveen
Top Poster
Top Poster
Posts: 205
Joined: Tue Dec 08, 2009 6:20 am

Usman55 wrote:
That is just awesome! When did you learn GDI+?
AI learned GDI+ graphis and to do coding and to make GDI+ effects from all of from Visual Studio 2008 help text book and from MSDN tutorials in web :)
User avatar
Usman55
VIP - Site Partner
VIP - Site Partner
Posts: 2821
Joined: Thu Dec 24, 2009 7:52 pm

Hello TVS Praveen,

I am very happy that our community has a great GDI+ teacher! This is another one of your great tutorials.

Thank You.
Image
User avatar
tvs praveen
Top Poster
Top Poster
Posts: 205
Joined: Tue Dec 08, 2009 6:20 am

Usman55 wrote:
Hello TVS Praveen,

I am very happy that our community has a great GDI+ teacher! This is another one of your great tutorials.

Thank You.

Okay, Stay tuned coming more tutorials of GDI+ on future wahooo;

I`m still working on making lots of GDI+ related tutorials :D
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Okay youve already answerd my post with what you posted :D Thanks
Image
User avatar
tvs praveen
Top Poster
Top Poster
Posts: 205
Joined: Tue Dec 08, 2009 6:20 am

lewisfroom wrote:
Okay youve already answerd my post with what you posted :D Thanks
What you mean?, :?

And what you talking about which post? :?
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

You gave me the answer to my question in a random post :D
Image
User avatar
tvs praveen
Top Poster
Top Poster
Posts: 205
Joined: Tue Dec 08, 2009 6:20 am

lewisfroom wrote:
You gave me the answer to my question in a random post :D
Okay :D
16 posts Page 1 of 2
Return to “Tutorials”