# Creating and drawing to a overlay

This topic is 4070 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, I am writing a screen magnification tool using overlays. To do this I opted to use DirectDraw (because it's the only way I found to do it). I have basically tryed everything, and nothing seams to work. Here is what I tryed so far: So I create my overlay surface, but doing this will always fail on my computer unless I use YUV color mode. Any attempts to create a RGB overlay surface fail with $88760091 Invalid Pixel Format. But then trying to use GetDC on the overlay canvas will fail with 88760249 Can't create DC So, I tryed to go around this, created a memory surface, use GetDC on it, draw to it, and tryed to use Blt to copy it's contents to the overlay, then I get:$887601AE Surface Busy So I thougth, ok, I will try to use UpdateOverlay to copy the contents of the memory surface to my overlay. Now this works, or at least I see something on the screen. But this is a corrupted image! Nothing really distinguable, I can only see that this is partially working because it changes when it should. So I thougth: Maybe this happens because my memory surface was created without pixel mode, let's create a memory surface with YUV pixel mode! That also fails, with \$88760091 Invalid Pixel Format Any ideas??? thanks a lot, Here is my full code: http://magnifier.cvs.sourceforge.net/magnifier/magnifierv3/libraries/pas_overlays/pas_overlays.dpr?revision=1.4&view=markup

1. 1
2. 2
frob
13
3. 3
4. 4
5. 5

• 9
• 13
• 14
• 67
• 14
• ### Forum Statistics

• Total Topics
632132
• Total Posts
3004299

×