Looking at pixels in DirectDraw (9)

OsirisGothra

Member
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 DirectX9s 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 .NETs 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 DX9s method? And if there is none, then how would i go about peeking at the pixels to find out where it ends myself?

gs
 
Youll have to use the Win32 API to measure the strings you want to output with DirectDraws DrawText. I cant rememeber the exact function, but its something like MeasureTextExtent or something like that. Theres 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