I have accomplished to create an image
I have a class (MySymbol) derived from Symbol.
and in Mysymbol I had put a field BitmapNode and append child it to my instance.
The problem is that the image appears far from the center of the symbol and when I move it it seems to mode exponentially far.... to right direction, and closer in left direction.
How can I center the image in my symbol and use it just as a symbol ?
Thanks.
SIGN IN To post a reply.
5 Replies
AD
Administrator
Syncfusion Team
August 26, 2004 06:56 PM UTC
Hi Rui,
Here is a sample that demonstrates what you are looking for. MySymbol is a custom Symbol which consists of an outer rectangle and a inner BitmapNode that is at the center of the outer rectangle.
Take a look at the code in MySymbol''s constructor where the innerimage''s X and Y (i.e. the center of the BitmapNode) are set to center it inside the outer rectangle as per your requirement.
Regards
Arun
AD
Administrator
Syncfusion Team
August 27, 2004 09:10 AM UTC
Ok... I''m now able to insert a symbol/image.
The problem I can''t resolve now is:
-with a rectangle symbol, the link between two symbols was starting and ending in the rectangles limit. Now, the links start and end in the image center... I don''t want that. I want to links to start and end at the limit of the symbol.
Can anyone help ?
Thanks
>Hi Rui,
>
>Here is a sample that demonstrates what you are looking for. MySymbol is a custom Symbol which consists of an outer rectangle and a inner BitmapNode that is at the center of the outer rectangle.
>
>Take a look at the code in MySymbol''s constructor where the innerimage''s X and Y (i.e. the center of the BitmapNode) are set to center it inside the outer rectangle as per your requirement.
>
>Regards
>Arun
AD
Administrator
Syncfusion Team
August 27, 2004 11:09 AM UTC
Hi Rui,
Calling:
this.CenterPort.AttachAtPerimeter = true;
will ensure that the link will terminate at the boundary of your symbol.
Regards
Arun
AD
Administrator
Syncfusion Team
August 27, 2004 11:48 AM UTC
I''m sorry but I tried to insert it in the symbols constructors code but it did not work.
Where should I insert the code ?
>Hi Rui,
>
>Calling:
>this.CenterPort.AttachAtPerimeter = true;
>
>will ensure that the link will terminate at the boundary of your symbol.
>
>Regards
>Arun
>
AD
Administrator
Syncfusion Team
August 27, 2004 05:05 PM UTC
Hi Rui,
Here is a sample demonstarting what was desscribed in the previous posting. Run the sample and try creating links between MySymbol and MyTriangle. Take a look at the underlying code in MySymbol.cs for MyTriangle. You will see that:
this.CenterPort.AttachAtPerimeter = true;
if you set it to true and then try creating links to MyTriangle, it will terminate at the center instead of the edge.
Regards
Arun
SIGN IN To post a reply.
- 5 Replies
- 1 Participant
-
AD Administrator
- Aug 26, 2004 08:20 AM UTC
- Aug 27, 2004 05:05 PM UTC