Drawing special text with gradient colors (Windows Forms VB.NET 1.

G

Guest

Hi,

I am building a splash screen, and I have a gradient color scheme for the
form ...

I am writing vertical and horizontal text on the form using the Graphics
object (in the Paint event) like this:
With e.Graphics
Dim oFontSplashHead As New Font("Comic Sans", 18)
Dim oBrushSplashHead As New SolidBrush(Color.LightGray)
Dim oVStringFormat As New
StringFormat(StringFormatFlags.DirectionVertical)

Dim oFontAppTitle As New Font("Tahoma", 14, FontStyle.Italic)
Dim oFontCompName As New Font("Tahoma", 32, FontStyle.Bold)
Dim oBrushAppTitle As New SolidBrush(Color.Crimson)

.DrawString(sCompanyName, oFontCompName, oBrushSplashHead, 0.0F, 60.0F,
oVStringFormat)

' Main Application Title
.DrawStringsApptitle1, oFontAppTitle, oBrushAppTitle, 245.0F, 70.0F)
.DrawString(sAppTitle2, oFontAppTitle, oBrushAppTitle, 245.0F, 92.0F)

End with
<<<< END CODE <<<<

Is there any way to have a gradient in the text of sAppTitle1 and
sAppTitle2, so at the top of the text, it is dark (where the form backround
is light) and at the bottom the text is lighter (in contast to the background
of the form where it gets darker)

How can I create a brush that will do that in vb.Net 1.1?

thanks for any help or ideas

Philip
 
C

ClayB

Try using System.Drawing.Drawing2D.LinearGradientBrush.

Dim rect As New Rectangle(35, 190, 100, 100)
Dim brush2 As New LinearGradientBrush(rect, Color.DarkOrange,
Color.Aquamarine, LinearGradientMode.ForwardDiagonal)
g.FillEllipse(brush2, 35, 190, 100, 100)

=================
Clay Burch
Syncfusion, Inc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top