Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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

MomentumXMomentumX Posts: 1Member
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.