Direct X 9 Font Help
Direct X 9 Font Help
Direct X 9 Font Help
Direct X 9 Font Help
Direct X 9 Font Help
Direct X 9 Font Help Direct X 9 Font Help Direct X 9 Font Help Direct X 9 Font Help Direct X 9 Font Help Direct X 9 Font Help Direct X 9 Font Help Direct X 9 Font Help
Direct X 9 Font Help Direct X 9 Font Help
Direct X 9 Font Help
Go Back  Xtreme Visual Basic Talk > > > > Direct X 9 Font Help


Reply
 
Thread Tools Display Modes
  #1  
Old 02-01-2006, 07:58 AM
AField AField is offline
Newcomer
 
Join Date: Feb 2006
Posts: 1
Default Direct X 9 Font Help


I use direct X to control image/text presentations (for academic research not game programming). Up to now, I've simply upgraded my VB6 programs into VB.net, and used the VB6 libraries. So, for example, I have some code as follows, which imports a surface and adds an "X" in the appropriate font/size etc.:

Private Sub AddX(ByRef surface As DxVBLib.DirectDrawSurface7)
Dim myfont As System.Drawing.Font = System.Windows.Forms.Control.DefaultFont.Clone()
Dim myIFont As DxVBLib.IFont
Dim x As Integer
Dim y As Integer


x = (primaryDescription.lWidth / 2) - 25
y = (primaryDescription.lHeight / 2) - 50

surface.SetForeColor(System.Drawing.ColorTranslator.ToOle(System.Drawi ng.Color.Red))
With myfont
myfont = VB6.FontChangeName(myfont, "trebuchet")
myfont = VB6.FontChangeSize(myfont, 70)
myfont = VB6.FontChangeBold(myfont, True)
myfont = VB6.FontChangeItalic(myfont, False)
End With


myIFont = VB6.FontToIFont(myfont)
surface.SetFont(myIFont)
surface.DrawText(x, y, "X", False)
End Sub

I'm trying to convert my code to Managed DirectX 9, and while I'm fine with my surfaces and so on. I cannot work out how to convert the above (and similar routines involving adding text to surfaces). I've fount a Font class, but don't seem to be able to do anything useful with it. I also haven't managed to track down any tutorials on Manged Direct X and adding text to surfaces.
I use Vb.net to program experiments for academic research, so I'm a researcher by profession, not a programmer: apologies for my inexperience and the fact this enquiry is probably stupid Any help really appreciated - I'm banging my head against a brick wall!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Direct X 9 Font Help
Direct X 9 Font Help
Direct X 9 Font Help Direct X 9 Font Help
Direct X 9 Font Help
Direct X 9 Font Help
Direct X 9 Font Help Direct X 9 Font Help Direct X 9 Font Help Direct X 9 Font Help Direct X 9 Font Help Direct X 9 Font Help Direct X 9 Font Help
Direct X 9 Font Help
Direct X 9 Font Help
 
Direct X 9 Font Help
Direct X 9 Font Help
 
-->