Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 886
  • Last Modified:

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
0
ChrisTheAvatar
Asked:
ChrisTheAvatar
1 Solution
 
HermeticCommented:
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.
0
 
PurpleFluxCommented:
Dim myFont As DxVBLib.IFont
0
 
dclaydonCommented:
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
0
 
jongoldfishCommented:
Hey Chris,

I don't know C#, but I am curious as to why you are using DirectX7?  DX9 has been out for a couple/few months now...
-fish
0
 
jongoldfishCommented:
A C-- Why did I only get a C grade?  Isn't C sorta like failing on this site...?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now