Jump to content
Xtreme .Net Talk

OsirisGothra

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by OsirisGothra

  1. Ok... yeah i fixed it using the GetTextExtentExPoint API function, works like a charm... :) YAY.... - Thanks Everyone For The Help! If anyone ever has trouble with this type of thing ask me for details on getting that to work in .NET osirisgothra@hotmail.com now i'm off to go make a new problem :)
  2. 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
  3. well then, is there a function simmilar to this for DirectDraw?
  4. Yes it is the same font object Might i add that the string in question is being drawn by a directdraw surface ddsurface.DrawText
  5. this is in VB.NET Dim W As Single Dim cFont as New Font("Times New Roman",12,FontStyle.Regular) v.FormatFlags = v.FormatFlags Or StringFormatFlags.MeasureTrailingSpaces W = owner.CreateGraphics.MeasureString(X(I), cFont, owner.Width, v).Width I've tried dest.X += Math.Round(W) and dest.X += W and dest.X += Convert.ToInt32(W) The X coordinate seems to end up anywhere from 4 to 20 pixels away from the actual end of the string on screen.
  6. If you want populate the tree all at once, I recommend a recursive function to do this... heres some psuedocode: functon addentry(rootnode as node, rootpath as string) get an array of each directory and enter it as a child in this node (be sure to grab a reference to the node you created just in case you have to use it when doing a recursive call) on each child node you add to this 'rootnode' you can check if the directory you are adding has any sub- directories.. if it does, have the function call ITSELF passing the child node and the rootpath + the directory name added to the end of it... otherwise just exit out of the function when you are done adding entries end function If you are reading a large drive though, the above article solves that problem... because populating all at once isnt neccisary unless you really need it :) hope that helped ...
  7. For some reason, I can never get an accurate measurement of a string... is this a problem for anyone else or is there something I am missing? Usually the string measurement is fine on smaller strings but once it gets more than a few characters long I find that it is reporting that it is much longer than it really is.. (esp. with say exclamation points and periods and such involved) Also, I am setting the string format to measure trailing spaces when needed... I also realize the .Width and .Height properties are single precision and I round them off or just use them as is, but it just seems that the measurements are WAY OFF sometimes!! :mad: Can anyone help me here!?
  8. Does anyone know a good way to create a non true type font (like Terminal) in VB.NET? Perhaps avoiding the dreaded API call.. and if not, with the API call? :eek:
  9. What is the best way to draw a rectangle with round edges?
  10. Had the same problem (I also had a copy of .NET from school) This seemed to fix the problem: from the run dialog or command line: regsvr32 "D:\Program Files\Common Files\Microsoft Shared\MSI Tools\mergemod.dll"
×
×
  • Create New...