//============================================================ // <T>设置处理。</T> //============================================================ public void Setup() { if (!_designLightColor.HasBrush()) { _designLightColor.Set(255, 255, 255, 255); _designLightColor.brush = _context.Device.CreateSolidBrush(_designLightColor); } if (!_designDarkColor.HasBrush()) { _designDarkColor.Set(0, 0, 0, 255); _designDarkColor.brush = _context.Device.CreateSolidBrush(_designDarkColor); } if (!_designBorderForeColor.HasBrush()) { _designBorderForeColor.Set(255, 255, 255, 255); _designBorderForeColor.brush = _context.Device.CreateSolidBrush(_designBorderForeColor); } if (!_designBorderBackColor.HasBrush()) { _designBorderBackColor.Set(0, 0, 0, 255); _designBorderBackColor.brush = _context.Device.CreateSolidBrush(_designBorderBackColor); } _designLineStrokeStyle = _context.Device.CreateStrokeStyle(EDxCapStyle.Flat, EDxCapStyle.Flat, EDxCapStyle.Flat, EDxDashStyle.Custom, new float[] { 6, 1 }); if (!_designGroundColor.HasBrush()) { _designGroundColor.Set(255, 255, 255, 255); _designGroundColor.brush = _context.Device.CreateSolidBrush(_designGroundColor); } // 设置文本格式 _defaultTextFormat = _context.Device.CreateTextFormat("NSimSun", "Normal", "Normal", "Normal", 12.0f, "NSimSun"); }
//============================================================ // <T>生成设计颜色。</T> // // @param color 颜色 // @return 颜色 //============================================================ public FUiColor BuildDesignColor(SColor color) { string code = color.ToValue().ToString(); FUiColor result = _designColors.Find(code); if (result == null) { result = new FUiColor(); result.Set(color.R, color.G, color.B, color.A); result.brush = _context.Device.CreateSolidBrush(result); _designColors.Set(code, result); } return(result); }