當前位置: 首頁>>代碼示例>>C#>>正文


C# BrushConverter.ConvertToString方法代碼示例

本文整理匯總了C#中System.Windows.Media.BrushConverter.ConvertToString方法的典型用法代碼示例。如果您正苦於以下問題:C# BrushConverter.ConvertToString方法的具體用法?C# BrushConverter.ConvertToString怎麽用?C# BrushConverter.ConvertToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Media.BrushConverter的用法示例。


在下文中一共展示了BrushConverter.ConvertToString方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: MainWindow

        public MainWindow()
        {
            InitializeComponent();
            vm = new GraphViewModel();
            DataContext = vm;

            //Set colors used by points
            InputPointColoBrush = this.Resources["InputPointColorBrush"] as SolidColorBrush;
            OutputPointColoBrush = this.Resources["OutputPointColoBrush"] as SolidColorBrush;

            BrushConverter converter = new System.Windows.Media.BrushConverter();

            string inputStrokeColor = converter.ConvertToString(InputPointColoBrush);
            string outputStrokeColor = converter.ConvertToString(OutputPointColoBrush);

            InputStroke = (Brush)converter.ConvertFromString(inputStrokeColor);
            OutputStroke = (Brush)converter.ConvertFromString(outputStrokeColor);
        }
開發者ID:fabanc,項目名稱:SharpBoostVoronoi,代碼行數:18,代碼來源:MainWindow.xaml.cs

示例2: TextFormat

 public TextFormat(double size, FontType ft, FontStyle fs, FontWeight fw, SolidColorBrush brush, bool useUnderline)
 {
     this.FontSize = Math.Round(size, 1);
     this.FontType = ft;
     this.FontFamily = FontFactory.GetFontFamily(ft);
     this.FontStyle = fs;
     this.UseUnderline = useUnderline;
     this.FontWeight = fw;
     this.TextBrush = brush;
     this.TypeFace = new Typeface(FontFamily, fs, fw, FontStretches.Normal, FontFactory.GetFontFamily(FontType.STIXGeneral));
     BrushConverter bc = new BrushConverter();
     TextBrushString = bc.ConvertToString(brush);
 }
開發者ID:JackWangCUMT,項目名稱:math-editor,代碼行數:13,代碼來源:TextFormat.cs


注:本文中的System.Windows.Media.BrushConverter.ConvertToString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。