Move dynamically new graphics entity in a graph picturebox ...

I have not managed to make a very simple thing (in VB6): move dynamically any new graphics entity (line, rectangle ellipse etc.) "overlay" to a control picturebox that already was plotted all other entities.

In VB.NET I used the event Paint to plot all entities of database, and this works perfectly (with few seconds for the regeneration of the graph), but the problem is the placement of new entities on event MouseMove using the new X and Y values:

In VB6 enough to plot entities in the XY current position and to plot the same entity to old position using an bitmap XOR that lets you "delete" the entity to its previous position from the background without a complete regen of all entities.

Now there is no longer VB.NET bitmap drawing entities mode (DrawMode) if I plot the new entity each MouseMove event, the graph is Dirtied along with the movement as a brush, and if I add a Refresh to every movement it is very slow because it would regenerate the entire graph to every mouse movement.

I have also tried to exploit the ability to copy the current background of the graph in a bitmap object to restore the background before any plot of the new entity in the current position but the copy operation and restore the background bitmap is slow as the entire reconstruction chart (new Paint event).

Is there a way to dynamically simulate the movement of an entity on a background bitmap according to the MouseMove?
Or a way to "save" a single portion of the background and then plot an entity and "restore" the portion of the screen to the next variation of shape position XY?

Sorry for the length of the post but it was difficult to explain ...
Thanks! Bye

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!