Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Philip - 08 Feb 2007 17:40 GMT
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:

>>> CODE >>>>
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
ClayB - 08 Feb 2007 18:14 GMT
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.
Stoitcho Goutsev (100) - 08 Feb 2007 20:38 GMT
Philip, you can add the text to a graphics path then widen the path and draw
it filled with wahtever brush you want.

Look at the GraphicsPath class
http://msdn2.microsoft.com/en-us/library/system.drawing.drawing2d.graphicspath.aspx

Signature

HTH
Stoitcho Goutsev (100)

> Hi,
>
[quoted text clipped - 37 lines]
>
> Philip

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.