IonicWind Software

Creative Basic => 2D/3D => Topic started by: TexasPete on March 31, 2010, 09:48:32 AM

Title: Removing graphic segments, lines, rectangles ect
Post by: TexasPete on March 31, 2010, 09:48:32 AM
I would like to know if there is a method to remove a graphic segement from the screen without clearing it. In the other language I was using there was a simple command. In translating , I did not find an equivilent command under the graphics section.

Any help or ideas would be appreciated. There might be an api command. I looked at allapi and did not find one. Maybe I was looking
under the wrong catagory.

Hopeful,
Texas Pete
Title: Re: Removing graphic segments, lines, rectangles ect
Post by: LarryMc on March 31, 2010, 09:51:14 AM
Hey Pete,
I don't even know what a "graphic segement " is.  ;) Never come across it in CB or EB.

As for lines and such the only thing I know to do is to overwrite using the background color.

Maybe someone else knows better.

LarryMc
Title: Re: Removing graphic segments, lines, rectangles ect
Post by: TexasPete on March 31, 2010, 01:57:26 PM
Larry in the other languae a graphic's segment is a line, retangle ect. In my object movement code I am trying to move a rectangle across the screen without disturbing the the graphics under the traingle. This helps the user see where he is putting the picture or text without messing up the graphics screen. I have not done any movement like this before in CB. So, I am having to write the code to do what I lack in a simple command.

I hope this explains what I am trying to do. Simply, clearing the screen after every movement would cause to much flickering.

Hopefully you are someone will have a workaround that I can use.

Thanks Texas Pete
P.S. I have been informed by another forum that there is no equivelent api. I hope they are wrong.
If you need to see the code I can send it to you.
Title: Re: Removing graphic segments, lines, rectangles ect
Post by: aurelCB on March 31, 2010, 02:01:56 PM
Yes what you mean graphic segment ???
Graphic segment can be everything.
And dont use termins like screen- dont get me wrong i know that you mean window.
Everything on window layer is based on hdc-right?
Title: Re: Removing graphic segments, lines, rectangles ect
Post by: ckoehn on March 31, 2010, 02:37:32 PM
I think what needs to be done is use a command like XOR.  You XOR your line with the screen and then you can XOR it again and it undoes what was done  ;D

I think there is probably a line drawing API that will work with XOR.  I don't have time now to look for it, maybe later this week.

Clint
Title: Re: Removing graphic segments, lines, rectangles ect
Post by: TexasPete on March 31, 2010, 03:49:33 PM
ckoehn,

I have been trying to use the xor and copypen raster modes. And Aurel, I know about the handle but I am not sure I know about handle for a drawn line or a drawn rectangle.

Texas Pete
Title: Re: Removing graphic segments, lines, rectangles ect
Post by: ZeroDog on March 31, 2010, 06:30:59 PM
the directx system is generally fast enough to redraw the background between FLIP commands.  Draw the background, then draw the rectangle in the appropriate spot for each iteration of the FLIP command.  You dont need to manually remove the rectangle time it is moved, just redraw the background, then draw the rectangle again.
Title: Re: Removing graphic segments, lines, rectangles ect
Post by: TexasPete on April 01, 2010, 03:59:10 PM
Choehn,

Choehn your method worked. I did not understand how XOR Worked. It did not work that way in the other language. This must have something to do with the other designer of the other compiler. ZeroDog Thank You for your suggestion. It was simple and intriguing but for this purpose I will use xor.
Thanks for every one's help.

Texas Pete