How I can do it !!!
-
HI ALL I want to draw circle on the screen(or desktop), I mean out of client window so I do like below : HDC hdc = CreateDC (TEXT ("DISPLAY"), NULL, NULL, NULL) ; it works but.................. then I do like below : InvalidateRect (NULL, &rc, TRUE) ; it erase the circle but.... When I use timer to draw circle and erase it quickly SetTimer (hwnd, ID_TIMER, 200, NULL) ; now the problem is apear when I erase the screen very quickly and repeatedly it makes the screen very shake ... How I can avoid this shake... THANK YOU AHMAD AL-WASHALI YEMEN washali@yahoo.com AHMAD ALWASHALI
-
HI ALL I want to draw circle on the screen(or desktop), I mean out of client window so I do like below : HDC hdc = CreateDC (TEXT ("DISPLAY"), NULL, NULL, NULL) ; it works but.................. then I do like below : InvalidateRect (NULL, &rc, TRUE) ; it erase the circle but.... When I use timer to draw circle and erase it quickly SetTimer (hwnd, ID_TIMER, 200, NULL) ; now the problem is apear when I erase the screen very quickly and repeatedly it makes the screen very shake ... How I can avoid this shake... THANK YOU AHMAD AL-WASHALI YEMEN washali@yahoo.com AHMAD ALWASHALI
the 'shaking' is the natural flickering caused by erasing the bg and redrawing ... in games and other graphics programming a technique called 'double-buffering' is used essentially you grab 2 lumps of memory big enough for a copy of the screen each and draw to these ... when you are ready to show a newly updated image you blit that to the screen and avoid the erase step now if you are doing this for the whole desktop i think you may have a problem as the rest of the image will be changing beyond your control so it will be almost impossible to know what has moved where hmmmmm..... maybe you could use a borderless window that is transparent and set to the lowest z order and draw to that ... it would give the same effect but you wouldn't have to worry about other images in your client area and then could use the double buffering technique above :cool: --- "every year we invent better idiot proof systems and every year they invent better idiots"
-
the 'shaking' is the natural flickering caused by erasing the bg and redrawing ... in games and other graphics programming a technique called 'double-buffering' is used essentially you grab 2 lumps of memory big enough for a copy of the screen each and draw to these ... when you are ready to show a newly updated image you blit that to the screen and avoid the erase step now if you are doing this for the whole desktop i think you may have a problem as the rest of the image will be changing beyond your control so it will be almost impossible to know what has moved where hmmmmm..... maybe you could use a borderless window that is transparent and set to the lowest z order and draw to that ... it would give the same effect but you wouldn't have to worry about other images in your client area and then could use the double buffering technique above :cool: --- "every year we invent better idiot proof systems and every year they invent better idiots"
-
Thank you lauren .:) but can I erase the area which I draw in ,I mean not whole screen just the area which I draw in ... AHMAD ALWASHALI
you don't draw directly to the desktop window at all you set up a window that has no border or title bar etc and that is transparent and draw to that ... it will look like it is being drawn to the desktop but in fact wont be hence you can do what you like to the window you own even if you have to copy the desktop to the window bg each time it will be far less data to copy than the whole desktop :suss: --- "every year we invent better idiot proof systems and every year they invent better idiots"
-
you don't draw directly to the desktop window at all you set up a window that has no border or title bar etc and that is transparent and draw to that ... it will look like it is being drawn to the desktop but in fact wont be hence you can do what you like to the window you own even if you have to copy the desktop to the window bg each time it will be far less data to copy than the whole desktop :suss: --- "every year we invent better idiot proof systems and every year they invent better idiots"