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.
Unfortunately, activation email could not send to your email. Please try again.

Change default alpha for new nodes

Thread ID:

Created:

Updated:

Platform:

Replies:

76151 Aug 25,2008 05:52 PM Aug 26,2008 10:33 AM Windows Forms 3
loading
Tags: Diagram
Kelly Harrison
Asked On August 25, 2008 05:52 PM

New here, so bear with me....

Is it possible to set the default alpha value for all new nodes added to a diagram?

Do I need to create a custom symbol?

Thanks!

-k


Kelly Harrison
Replied On August 25, 2008 06:06 PM

I guess I should point out that I'm working with rectangles exclusively. I'm messing around with the DrawShapes_2008 sample.

-k

>New here, so bear with me....

Is it possible to set the default alpha value for all new nodes added to a diagram?

Do I need to create a custom symbol?

Thanks!

-k




J.Nagarajan [Syncfusion]
Replied On August 26, 2008 01:04 AM

Hi ,

Thanks for your interest in Syncfusion products.

To change the default alpha factor of the nodes, you have to handle NodeCollectionChanging event of DocumentEventSink and use FillStyle.ColorAlphaFactor of the node in this event. Please refer to the below code snippet.

this.diagram1.Model.EventSink.NodeCollectionChanging += new CollectionExEventHandler(EventSink_NodeCollectionChanging);
void EventSink_NodeCollectionChanging(CollectionExEventArgs evtArgs)
{
if (evtArgs.Element is Rectangle)
{
Rectangle m_rect = evtArgs.Element as Rectangle;
m_rect.FillStyle.ColorAlphaFactor = 80;
}
}

Here is the working sample.

http://websamples.syncfusion.com/samples/Diagram.Windows/F76151/main.htm

Please let me know if this helps.

Thanks,
Nagaraj


Kelly Harrison
Replied On August 26, 2008 10:33 AM

Perfect - thanks!

-k

>Hi ,

Thanks for your interest in Syncfusion products.

To change the default alpha factor of the nodes, you have to handle NodeCollectionChanging event of DocumentEventSink and use FillStyle.ColorAlphaFactor of the node in this event. Please refer to the below code snippet.

this.diagram1.Model.EventSink.NodeCollectionChanging += new CollectionExEventHandler(EventSink_NodeCollectionChanging);
void EventSink_NodeCollectionChanging(CollectionExEventArgs evtArgs)
{
if (evtArgs.Element is Rectangle)
{
Rectangle m_rect = evtArgs.Element as Rectangle;
m_rect.FillStyle.ColorAlphaFactor = 80;
}
}

Here is the working sample.

http://websamples.syncfusion.com/samples/Diagram.Windows/F76151/main.htm

Please let me know if this helps.

Thanks,
Nagaraj




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;