Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello,

I am writing a program that needs an acurate measurement of strings of characters outputed by DirectX9's DirectDraw.Surface.DrawText method.

First of all, this is all happening in VB.NET and.. of course my first natural instinct was to try using .NET's Graphics.MeasureString method except that the text being measured of course is based on the output that GDI+ would of produced.. yes it works fine under GDI+ but unfortunately it just isnt fast enough... DX9 is plenty fast enough in fact i had to slow it down a bit... but... the problem remains on how do you measure a string outputed by DX9's method? And if there is none, then how would i go about 'peeking' at the pixels to find out where it ends myself?

 

gs

  • *Experts*
Posted

You'll have to use the Win32 API to measure the strings you want to output with DirectDraw's DrawText. I can't rememeber the exact function, but it's something like MeasureTextExtent or something like that. There's another thread on Drawing strings in DirectX in the Graphics forum. You should take a look there for a link on the problems with GDI+'s MeasureString.

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...