Link to home
Start Free TrialLog in
Avatar of ChrisTheAvatar
ChrisTheAvatar

asked on

DirectX7 (DirectDraw) and C#

Good evening,

I am having problems with setting fonts using DirectX7, mainly dealing with the directdrawsurface7.setfont() function. everything else seems to be working wonderfully.

The acctual problem is the setfont function wants me to pass a IFont type (Interface) object, and I cannot create a instance nor can I inherit the Interface by another class. Is there any work around API I can possibly call or is there anyway to create a IFont Type.

Thanks for your help

Chris The Avatar
Avatar of Hermetic
Hermetic

You must be using VB.  According to microsoft archived content:

The IFont class is used by the DirectDrawSurface7.SetFont method to specify the font used in the DirectDrawSurface7.DrawText method.

For information on this class and its associated methods, see the Font class documentation in Visual Basic.

My guess from this, dim an "IFont" object.  If that doesn't work, dim a "Font" object.
Dim myFont As DxVBLib.IFont
Get the hFont (handle to font) information and pass it by reference (which in turn becomes an IFont).

You should be able to create a handle for a font and set the properties.

This should work with C#.

DC
ASKER CERTIFIED SOLUTION
Avatar of jongoldfish
jongoldfish
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
A C-- Why did I only get a C grade?  Isn't C sorta like failing on this site...?