Albert

Albert

  • NA
  • 10
  • 0

Exception when using the DrawText funtion

Mar 2 2007 4:46 AM

Does anybody know why I am getting an exception with this code? At first it said the word new has to be used, but now it's just a general exception. I would appreciate your assistance. Thank you.
//The graphics variable is defined on the top
Direct3D.Device graphics = null;
//This is inisde a render function

System.Drawing.Font sysfont = null;

Direct3D.Font dxfont = null;

sysfont = new System.Drawing.Font("Times New Roman", 14, System.Drawing.FontStyle.Italic |
FontStyle
.Underline);

dxfont = new Direct3D.Font(graphics, sysfont);

Rectangle rec = new Rectangle(0, 0, 640, 100);

dxfont.DrawText(null,"Star of David",rec,Direct3D.DrawTextFormat.NoClip, Color.Gold);