We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Drawing Node''s selection my own way ?

here is what i want to do .. but i don''t know how !! I have ImageNode .. but i want it to be transparent while the user is moving it !! instead of the dashed rectangle ? how can i do this ?

5 Replies

MI mido June 19, 2005 03:22 AM

i would like to add that i don''t want to make the image fully transparent while the user move it .. but i want to make it 50% transparent .. does SyncFusion support this ? best regards, Seko


AD Administrator Syncfusion Team June 21, 2005 10:08 AM

Hi Seko, It is possible to change the tracking image drawn when moving a node, but the implementation is not exactly trivial. If you would like to try this on your own, the following outline should help you get started. The tracking rectangle that you notice when a node is moved is drawn by the Essential Diagram MoveTool using the Syncfusion.Windows.Forms.Diagram.NodePathTracker class for the actual rendering. To change the tracking rectangle, you will have to first implement a custom MoveTool that creates a customized version of the NodePathTracker class from it''s IMouseEventReceiver.MouseMove() implementation. In your custom NodePathTracker, you will have to override the NodePathTracker.MouseMove method, and in place of the call to the View.DrawMouseTracker(Rectangle) method, you will instead invoke a custom method added to a subclass of the Diagram''s View that will render an alpha-blended outline of the image node. The following Essential Diagram KB links shows how to replace a Diagram interactive tool with a customized one - http://www.syncfusion.com/support/kb/diagram/Default.aspx?ToDo=view&questId=48. The following KB article details how to subclass the Diagram View component - http://www.syncfusion.com/support/kb/diagram/Default.aspx?ToDo=view&questId=31. The following Essential Diagram KB link Regards, Prakash Surendra Syncfusion Inc.,


MI mido June 22, 2005 04:10 PM

thanks alot it is working now .. but i have a little problem .. the images flicker while being dragged .. any ideas on how to fix this ??? thanks a lot ..


AD Administrator Syncfusion Team June 22, 2005 05:09 PM

Seko, Are you implementing the node tracking by shifting the node location? This is likely to cause the flickering that you have noticed, as changes to the node state will trigger off a redraw of the entire diagram model. Instead, you will have to use an approach similar to that used by the NodePathTracker and directly render the node into the View''s Graphics object as shown in the View.DrawMouseTracker() method. Hiding the node at the start off the move operation, and from then on drawing the node at the cursor''s current location in response to the mouse move event, and finally displacing the node to it''s final location and unhiding it will help you simulate node movement without any flicker. Regards, Prakash Surendra Syncfusion Inc,


MI mido June 23, 2005 01:18 AM

hi Prakash, thanks for your valuable support I have noticed that the flicker exist in your syncfusion dashed rectangle too !! .. btw,i have implemented it by drawing the images as you said by calling View.MyDrawTrackingImage in MyNodePathTracker.Move(dx,dy) .. not by moving the Nodes & i have the flickering :( .. thanks a lot best regards, Seko

Loader.
Live Chat Icon For mobile
Up arrow icon