I've been working with divelements controls for several years now - and writing my own custom render classes to suit my specific needs.
Anyway, I thought I'd make a quick post here to show those of you who do like myself - how to create anti-aliased text for your applications.
I do NOT own EyeFinder 1.3 or higher so the routine *might* be called something different now but I highly doubt it. Nevertheless, it'll be up to you 1.3+ owners to check first.
Here's the old-school way of displaying text:
Public Overrides Sub DrawHeader(ByVal graphics As System.Drawing.Graphics, ByVal bounds As System.Drawing.Rectangle, ByVal text As String, ByVal font As System.Drawing.Font, ByVal image As System.Drawing.Image, ByVal rtl As Boolean)
dim FontBrush as New SolidBrush(color.black)
Dim TextFormat As New StringFormat
TextFormat.FormatFlags = StringFormatFlags.NoWrap
TextFormat.Trimming = StringTrimming.EllipsisCharacter
TextFormat.Alignment = StringAlignment.Center
TextFormat.LineAlignment = StringAlignment.Center
graphics.DrawString(text, font, FontBrush, bounds, TextFormat)
*************
The above code will do exactly like you expect: Draws a string using the color described in FontBrush...
But what if you want anti-aliased fonts like those found in Outlook 07 ?
Well - it's really not much different!
Instead of using the GDI method, Drawstring...instead use FillPath - of course you'll have to build your path but fortunately, paths are already setup to accept text:
Dim TextGraphicsPath As New GraphicsPath
TextGraphicsPath.AddString(pane.Text, font.FontFamily, font.Style, font.Size + 3, bounds, TextFormat)
graphics.SmoothingMode = SmoothingMode.AntiAlias
graphics.FillPath(FontBrush, TextGraphicsPath)
* Note *
See the +3 I threw onto the font.size parameter? That's because drawing text like this will make it smaller than you expected...I have no clue why and it's 3:30am here so I'm too tired to care at this time! If one of you excellent coders reading this happens to know why - please post a reply to let me and everyone else know!
Enjoy :)
-Elkay