469,631 Members | 1,340 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,631 developers. It's quick & easy.

how to draw image directly onto screen

Hi, all,

I want to draw image directly onto top of screen, which simulates the
OSD(on screen display) effects. However, class Graphics must link to
certain controls, that cannot be used to draw at an arbitary position.
Does anyone know any approaches can perform this job?

thanks,

Aug 4 '06 #1
2 2870
You should be able to call the GetDesktopWindow API function through
PInvoke. With that handle, you can then get the device context for the
window (through GetDC I believe). Then, you can pass that device context
handle to the static FromHdc method on the Graphics class to get a Graphics
instance to draw with.

However, you will have to be careful of refresh issues.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<my****@gmail.comwrote in message
news:11*********************@i42g2000cwa.googlegro ups.com...
Hi, all,

I want to draw image directly onto top of screen, which simulates the
OSD(on screen display) effects. However, class Graphics must link to
certain controls, that cannot be used to draw at an arbitary position.
Does anyone know any approaches can perform this job?

thanks,

Aug 4 '06 #2
Paldino,

Thanks for your reply. I'll have a try at once:)

Nicholas Paldino [.NET/C# MVP] wrote:
You should be able to call the GetDesktopWindow API function through
PInvoke. With that handle, you can then get the device context for the
window (through GetDC I believe). Then, you can pass that device context
handle to the static FromHdc method on the Graphics class to get a Graphics
instance to draw with.

However, you will have to be careful of refresh issues.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<my****@gmail.comwrote in message
news:11*********************@i42g2000cwa.googlegro ups.com...
Hi, all,

I want to draw image directly onto top of screen, which simulates the
OSD(on screen display) effects. However, class Graphics must link to
certain controls, that cannot be used to draw at an arbitary position.
Does anyone know any approaches can perform this job?

thanks,
Aug 4 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

21 posts views Thread by DraguVaso | last post: by
6 posts views Thread by redneon | last post: by
7 posts views Thread by lgbjr | last post: by
3 posts views Thread by Rob Willaar | last post: by
reply views Thread by news | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.