IonicWind Software

IWBasic => General Questions => Topic started by: barry on January 26, 2007, 09:15:38 AM

Title: Bitmap layers
Post by: barry on January 26, 2007, 09:15:38 AM
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
Title: Re: Bitmap layers
Post by: Ionic Wind Support Team 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.

Paul.
Title: Re: Bitmap layers
Post by: barry on January 26, 2007, 07:18:12 PM
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
Title: Re: Bitmap layers
Post by: Ionic Wind Support Team on January 26, 2007, 09:55:11 PM
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.
Title: Re: Bitmap layers
Post by: barry on January 27, 2007, 07:33:56 AM
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
Title: Re: Bitmap layers
Post by: Ionic Wind Support Team on January 27, 2007, 08:49:54 AM
Yes.  Just load the sprites in system ram, instead of video ram. 
Title: Re: Bitmap layers
Post by: Brice Manuel on January 29, 2007, 02:47:12 AM
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.
Title: Re: Bitmap layers
Post by: barry on January 29, 2007, 02:50:44 PM
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