Author |
Message |
Doc Flabby Guest
Offline
|
Posted: Fri Feb 24, 2006 2:01 pm Post subject: Writing directly to the screen |
|
|
|
|
im not overly familiar with graphics and directx, but on my laptop when i press keys like to change volume it overlays an image on top of all the windows. I was just wondering if anyone knows how is that done. or where i can find information on it.
I was thinking of using it to display the music track you are playing on winamp in ss (or other games) |
|
Back to top |
|
|
Mr Ekted Movie Geek
Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Fri Feb 24, 2006 2:19 pm Post subject: |
|
|
|
|
Using the Win32 API, you can call GetDC(0) to get the HDC for the entire screen. Then all normal device context calls write an top of anything.
SelectObject()
SetTextColor()
SetBkColor()
SetBkMode()
SetTextAlign()
TextOut()
DrawText()
etc.
Note that if you write on top of windows, they will be left with junk on them. This is not considered to be a very Windows-friendly method.
I would recommend creating a little window to put your information in. It doesn't have to have a border, a title bar, a menu, etc. When this window closes, windows behind it will redraw as normal. _________________ 4,691 irradiated haggis! |
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Fri Feb 24, 2006 3:53 pm Post subject: |
|
|
|
|
Actually, I think the laptop thing is a kind of OSD (on-screen display) done by the video card itself. _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him. |
|
Back to top |
|
|
Doc Flabby Guest
Offline
|
Posted: Sat Feb 25, 2006 10:25 am Post subject: |
|
|
|
|
Mr Ekted wrote: | Using the Win32 API, you can call GetDC(0) to get the HDC for the entire screen. Then all normal device context calls write an top of anything.
SelectObject()
SetTextColor()
SetBkColor()
SetBkMode()
SetTextAlign()
TextOut()
DrawText()
etc.
Note that if you write on top of windows, they will be left with junk on them. This is not considered to be a very Windows-friendly method.
I would recommend creating a little window to put your information in. It doesn't have to have a border, a title bar, a menu, etc. When this window closes, windows behind it will redraw as normal. |
Thank you!! thats just the point in the right direction i needed. Windows Api is not something im that familiar with. Give it a few weeks (got quite a lot of things to do) and ill post the program up lol. |
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sat Feb 25, 2006 11:39 pm Post subject: |
|
|
|
|
It takes more than a few weeks to get "familiar" with the Windows API. It's quite a monster. |
|
Back to top |
|
|
doc Flabby Guest
Offline
|
Posted: Sun Feb 26, 2006 7:32 am Post subject: |
|
|
|
|
no doubt. Im not new to using the windows API but i've never used it to produce graphics so my knoledge in this area was nonexistant. There are so many functions. Its knowing the right ones that is the hard thing! Using it is the easier part. Thats what i was trying to say |
|
Back to top |
|
|
|