April 19, 2024, 12:50:53 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Removing graphic segments, lines, rectangles ect

Started by TexasPete, March 31, 2010, 09:48:32 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TexasPete

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

LarryMc

March 31, 2010, 09:51:14 AM #1 Last Edit: March 31, 2010, 09:53:14 AM by Larry McCaughn
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
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

TexasPete

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.

aurelCB

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?

ckoehn

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

TexasPete

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

ZeroDog

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.

TexasPete

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