本文整理汇总了C#中System.Windows.Media.Color.FromRgb方法的典型用法代码示例。如果您正苦于以下问题:C# Color.FromRgb方法的具体用法?C# Color.FromRgb怎么用?C# Color.FromRgb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.Color
的用法示例。
在下文中一共展示了Color.FromRgb方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddPath
public Feature AddPath(String Id, Latitude Latitude, Longitude Longitude, Double Width, Double Height, Color Color)
{
var XY = GeoCalculations.GeoCoordinate2ScreenXY(Latitude, Longitude, MapControl.ZoomLevel);
var PathGeometry1 = PathGeometry.Parse("M51,42c-5-4-11-7-19-7c-6,0-12,1-20,5l10-35c20-8,30-4,39,2l-10,35z");
var PathGeometry2 = PathGeometry.Parse("M106,13c-21,9-31,4-40-2l-10,35c9,6,20,11,40,2l10-35z");
var PathGeometry3 = PathGeometry.Parse("M39,83c-9-6-18-10-39-2l10-35c21-9,31-4,39,2l-10,35z");
var PathGeometry4 = PathGeometry.Parse("M55,52c9,6,18,10,39,2l-10,35c-21,8-30,3-39-3l10-34z");
var pathText = PathGeometry1.ToString();
var GD1 = new GeometryDrawing(new SolidColorBrush(Color.FromRgb(0xE0, 0x60, 0x30)), null, PathGeometry1);
var GD2 = new GeometryDrawing(new SolidColorBrush(Color.FromRgb(0x70, 0xB0, 0x40)), null, PathGeometry2);
var GD3 = new GeometryDrawing(new SolidColorBrush(Color.FromRgb(0x40, 0x90, 0xc0)), null, PathGeometry3);
var GD4 = new GeometryDrawing(new SolidColorBrush(Color.FromRgb(0xF0, 0xD0, 0x50)), null, PathGeometry4);
var DrawingGroup = new DrawingGroup();
DrawingGroup.Children.Add(GD1);
DrawingGroup.Children.Add(GD2);
DrawingGroup.Children.Add(GD3);
DrawingGroup.Children.Add(GD4);
var DrawingBrush = new DrawingBrush() {
Drawing = DrawingGroup,
TileMode = TileMode.None
};
var Feature = new Feature(Id, new RectangleGeometry() { Rect = DrawingGroup.Bounds }) {
Latitude = Latitude,
Longitude = Longitude,
Width = DrawingGroup.Bounds.Width,
Height = DrawingGroup.Bounds.Height,
Fill = DrawingBrush,
ToolTip = Id
};
// The position on the map will be set within the PaintMap() method!
this.Children.Add(Feature);
return Feature;
}