Hello everyone :lol:
I use DrawText() to draw some text on a window's DC. But if i resize the window, the text will be resized also. What i want is the window can be resized, but the text on it will not be resized. Because the text will hard to see if the window is too small.

I hope i can be understood by you.
Any help will be appreciated.
Best regards.
Posted on 2005-10-09 20:57:26 by Rey
Basically in this order. Create a font and get its handle, get the device context of the window you want to draw it on, select the font handle into the device context saving the old value, display the text with DrawText or TextOut, release the device context, reselect the old font handle and when you app quits, delete the font handle with DeleteObject().
Posted on 2005-10-09 21:24:07 by hutch--
Do you want to draw text so it goes outside the boundaries of the window? Ie, if the user resizes the window to 100 pixels, you still want do draw text of for instance 200 pixels width?

That *is* possible, but you'll have to use a global HDC (like one for the desktop), and this is somewhat "dirty" and there's plenty of redrawing problems to handle...
Posted on 2005-10-10 00:19:20 by f0dder
hi  f0dder.
What i want is somewhat like what you have said. But i don't want the text goes outside the window's boundares. Windows can be resized by the user ,but the text displayed on it will not be resized, cuz i need to put some information on the window's DC ( let's say the user's machine name and the machine's IP). Users won't feel good if the text is too small to recognize as the windows' size turn small.
I have a feeling  just like what hutch have said that this have something to do with the font i use! Am i right?
Ha , i almost forget this: The DC i used is not a regular window's DC , but a DC of a DirectDraw object!!

Do you have any ideal now?
Thank you.
Best regards!
Posted on 2005-10-10 03:35:39 by Rey
There's no real difference in DC handle obtained from a GDI function and DC handle obtained from a DDraw method (in terms of drawing a text), however I suggest you NOT using the GDI if you do some time-critical painting (like a real-time game, where FPS matter).
Posted on 2005-10-11 20:16:34 by ti_mo_n
hello ti_mo_n

If there is no difference between DC from windows and DC form a DDraw object, why the size of text drawed on a regular window's DC won't turn small or turn big while the window being resized?

Anyway . could you tell me how to draw text using DDraw methods?
Thank you !
Best regards

Posted on 2005-10-12 03:53:14 by Rey
I don't remember DirectDraw now, but I do remember that I did some drawing with DDraw's DC using GDI functions with no problem.

Switch to DX9.0, where you can display the text with few calls and also utilize the GPU properly.




I wanted to add an example, but the forum script says that "attachment directory is not writable" :|
Posted on 2005-10-12 16:03:52 by ti_mo_n
Thank you anyway.
Best regards.
Posted on 2005-10-13 03:17:26 by Rey