Looking at pixels in DirectDraw (9)

OsirisGothra

Newcomer
Joined
May 29, 2003
Messages
10
Location
Denver
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
 
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
 
Back
Top