I'm doing a little thing like a coloring book and it occurred to me that an eraser might be nice but only if it could erase back to the base line drawing. I assume that would require some kind of layer effect such as is found in Corel Draw and Photoshop.
I can see how that might be done with double buffering but is there some built-in way to do it in either GDI or Ebasic?
Barry
Would be easy enough to do using a 2D screen. With a window you'll need to do it the Microsoft way, creat a bitmap, bitblt the erased part so you can 'undo' etc.
Paul.
Quote from: Paul Turley on January 26, 2007, 03:18:48 PM
Would be easy enough to do using a 2D screen. With a window you'll need to do it the Microsoft way, creat a bitmap, bitblt the erased part so you can 'undo' etc.
I don't really understand. Are you talking about Directx?
This is in a 500x500 graphics window in a windowed program. Erase isn't really critical but it would be a nice addition. Maybe I'll consider adding that in a second version.
Barry
You can attach a 2D DirectX screen to any window. Using sprites to display the bitmaps allows keeping more than one copy so erasing and un erasing is just a matter of drawing to a different sprite.
Paul.
I guess I thought of sprites as small rectangular fixed objects, as in days of old. So I can use a sprite as a bitmap covering a 500x500 window and draw to it? Great!
I'll play with that. I wasn't going to use Directx for this but maybe I will.
Barry
Yes. Just load the sprites in system ram, instead of video ram.
Barry: Like Paul said, what you want to do is very "doable" with the 2D commands. I have been working on a 2D version of the old "paper dolls" for my daughter.
I'm going to just leave out the eraser for now and settle for an undo button. I want to get this done. Then I'll probably do it again in DX with the sprites.
Barry