SilverScreen Solid Modeler

FromColor method

FromColor method

Previous topic Next topic  

FromColor method

Previous topic Next topic JavaScript is required for the print function  

SilverSharpAPI

 

static SS_RGB FromColor(System.Windows.Media.Color clr);

 

System.Windows.Media.Color clr;  // A System.Windows.Media.Color instance

 

 

 




Synopsis

using SilverSharp;

 

The FromColor method creates a SilverSharp.SS_RGB object from a System.Windows.Media.Color object.

 

 

Parameters

clr is a System.Windows.Media.Color object used to initialize the SilverSharp.SS_RGB object.

 

 

Return Value

FromColor returns a SilverSharp.SS_RGB object

 

 

Remarks

This method is most useful with WPF applications

 

 

See Also

SS_RGB, ToColor

 

 

Example

The following code creates a SilverSharp.SS_RGB object from a WPF color and uses it to set the current background color:

 

C# Code for WPF

 

 using SilverSharp;

 using System.Windows.Media;

 

 . . .

 

 SS_RGB bg = SS_RGB.FromColor(Colors.DeepSkyBlue);

 

 SC.ss_command("paint background color {0}", bg);

 

 

Note: The ToString method is implied in the above code