Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Need Shadow of ImageRectangle Only (Read 4817 times)
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Need Shadow of ImageRectangle Only
Aug 4th, 2010 at 3:25pm
Print Post  
Hi,

We have custom shaped ShapeNode in our diagram. In this Shape we have defined two regions, one is for ImageRectangle which is inside the Shape and another is for TextRegion which is outside the Shape. When we apply shadow on this Shape, shadow comes on Text as well. We want Shadow only on ImageRectangle's portion (not on the text).

Please suggest, how can I get this?

Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Need Shadow of ImageRectangle Only
Reply #1 - Aug 5th, 2010 at 5:15am
Print Post  
Hi,

ShadowEffect applies to the whole visual element, so you will have to use two elements one way or another. E.g. display the text inside an attached node and assign the effect only to the main node. Or you could define a node template (with v2.4 ) where only the graphic element in the template shows a shadow effect, and the TextBlock does not.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Need Shadow of ImageRectangle Only
Reply #2 - Aug 5th, 2010 at 5:47am
Print Post  
Thanks Stoyan Smiley

Could you please let us know the tentative release date of v2.4?

Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Need Shadow of ImageRectangle Only
Reply #3 - Aug 5th, 2010 at 6:13am
Print Post  
Jul 7th, 2010 Smiley

Regards,
Stoyan
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Need Shadow of ImageRectangle Only
Reply #4 - Sep 16th, 2010 at 2:23pm
Print Post  
Hi Stoyan,

Could you please let us know how we can make a node template that will apply shadow effect only on Graphics(not on TextBlock)?

Code snippet for our ShapeNode is:

textOnTheRight = new MindFusion.Diagramming.Wpf.Shape(
                Shapes.Rectangle.Outline,// reuse the rectangular shape
                null,// no decorations
                new ElementTemplate[]// define text region
                   {
                       new LineTemplate(32, 19, 90, 19),
                       new LineTemplate(90, 19, 90, 79),
                       new LineTemplate(90, 79, 32, 79),
                       new LineTemplate(32, 79, 32, 19)
                   },
                    FillRule.EvenOdd,// doesn't matter here
                    "TextOnTheRight"// to access the shape later using Shape.FromId
                );

Regards,
Anshul
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Need Shadow of ImageRectangle Only
Reply #5 - Sep 17th, 2010 at 5:40am
Print Post  
Hi Stoyan,

Any pointer for this?

Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Need Shadow of ImageRectangle Only
Reply #6 - Sep 17th, 2010 at 11:54am
Print Post  
Hi,

Tutorial 3 shows how to create a node template. You can define two rows for the outer grid, assign a drop-shadow effect to the <Rectangle> element, and move the TextBlocks to the second row of the outer grid.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Need Shadow of ImageRectangle Only
Reply #7 - Sep 17th, 2010 at 2:00pm
Print Post  
Hi Stoyo,

Thanks for the reply.

I am not able to figure out Tutorial 3 containing any of  the templeting on the node.

Also I am assigning a custom shape to the ShapeNodes defined like:

textOnTheRight = new MindFusion.Diagramming.Wpf.Shape(
               Shapes.Rectangle.Outline,// reuse the rectangular shape
               null,// no decorations
               new ElementTemplate[]// define text region
                  {
                      new LineTemplate(32, 19, 90, 19),
                      new LineTemplate(90, 19, 90, 79),
                      new LineTemplate(90, 79, 32, 79),
                      new LineTemplate(32, 79, 32, 19)
                  },
                   FillRule.EvenOdd,// doesn't matter here
                   "TextOnTheRight"// to access the shape later using Shape.FromId
               );


Please let know using the same shape how could I apply the template to the node.



Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Need Shadow of ImageRectangle Only
Reply #8 - Sep 17th, 2010 at 2:23pm
Print Post  
You can use only TemplatedNodes with such templates, and not ShapeNodes. You can find the complete VS project for Tutorial 3 installed under the control's installation folder, Samples\C#\Tutorial3 or Samples\VB.NET\Tutorial3.
From the test projects you sent us, it seems you are already using grouped ShapeNodes. If you are not comfortable with templates, you could continue using groups and add a new node only to display the shadow, turning it off for the other nodes.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint