April 26, 2024, 11:30:25 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Bitmap layers

Started by barry, January 26, 2007, 09:15:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

barry

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

Ionic Wind Support Team

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.
Ionic Wind Support Team

barry

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

Ionic Wind Support Team

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.
Ionic Wind Support Team

barry

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

Ionic Wind Support Team

Yes.  Just load the sprites in system ram, instead of video ram. 
Ionic Wind Support Team

Brice Manuel

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.

barry

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