|
-
February 28th, 2008, 01:39 AM
#3
Re: Drawing On Top Of Another Application
 Originally Posted by jon.borchardt
Im not sure this is not working for you, but at very least, I would get the graphics reference from within the timer and release it when done...
Code:
private void timer1_Tick(object sender, EventArgs e)
{
using(Graphics eqGraphic = Graphics.FromHwnd(ptr))
{
eqGraphic.DrawString("HELLO", font, brush, new PointF(100, 100));
}
}
I would guess this is not working for you because you dont have the right pointer to create the graphics object, can you make it work first with a known graphics object... like inside a picturebox?
Well, I released the graphic object in the FormClosing event instead, I don't know what's more efficient.
The problem isn't that it doesn't paint it in the window (it does), but that it instantly disappears, thus if I increase the interval number for the timer, the text instantly disappears and reappears at a decreased interval.
I don't know if this is a question for a GDI forum instead, perhaps?
Sincerely,
Martin Svendsen
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|