颜色枚举
/// <summary>
/// 颜色枚举
/// </summary>
public enum ColorConstants
{
Red = 16711680,
Green = 65280,
Blue = 255,
}
绘制圆
public class CircleGraphic : VMControls.RenderInterface.ICircle
{
/// <summary>
/// 圆心坐标
/// </summary>
public float CenterX{ get; set; }
/// <summary>
/// 圆心坐标
/// </summary>
public float CenterY{ get; set; }
/// <summary>
/// 内部圆环半径
/// </summary>
public float MinorRadius{ get; set; }
private float _MajorRadius;
/// <summary>
/// 外部圆环半径
/// </summary>
public float MajorRadius
{
get { return _MajorRadius; }
set { _MajorRadius = value;
MinorRadius = _MajorRadius - 2;
}
}
/// <summary>
/// 圆的透明度
/// </summary>
public float Opacity{ get; set; }
/// <summary>
/// 系统提供的颜色设置
/// </summary>
public int Color{ get; set; }
/// <summary>
/// 系统提供的颜色设置
/// </summary>
public int FillColor{ get; set; }
/// <summary>
/// 显示细条粗细
/// </summary>
public float StrokeThickness{ get; set; }
/// <summary>
/// 颜色枚举
/// </summary>
public ColorConstants ColorConstants
{
set
{
Color = (int)value;
FillColor = Color;
}
}
public CircleGraphic()
{
this.ColorConstants = ColorConstants.Green;
this.FillColor = this.Color;
this.Opacity = 1;
this.StrokeThickness = 10;
}
}
绘制文本
/// <summary>
/// 标签文本显示
/// </summary>
public class LableGraphic : VMControls.RenderInterface.IText,IDisposable
{
#region Public-Members
/// <summary>
/// 文本内容
/// </summary>
public string Content { get; set; }
/// <summary>
/// 显示位置
/// </summary>
public float PositionX { get; set; }
/// <summary>
/// 显示位置
/// </summary>
public float PositionY { get; set; }
/// <summary>
/// 显示文本框宽度
/// </summary>
public float Width { get; set; }
/// <summary>
/// 显示文本框高度
/// </summary>
public float Height { get; set; }
/// <summary>
/// 显示文本大小
/// </summary>
public int FontSize { get; set; }
/// <summary>
/// 显示文本透明度 , 0 不透明
/// </summary>
public float Opacity { get; set; }
/// <summary>
/// 显示文本颜色,取代系统的Color属性用
/// </summary>
public ColorConstants ColorConstants
{
set
{
Color = (int)value;
FillColor = Color;
}
}
/// <summary>
/// 显示文本颜色,默认等于Color数值
/// </summary>
public int FillColor { get; set; }
/// <summary>
/// 显示文本粗细
/// </summary>
public float StrokeThickness { get; set; }
/// <summary>
/// 系统提供的颜色.Int 类型
/// </summary>
public int Color { get; set; }
#endregion
#region Private-Members
#endregion
#region Constructors-and-Factories
public LableGraphic()
{
FontSize = 35;
PositionX = 200;
PositionY = 200;
ColorConstants = ColorConstants.Green;
}
public void Dispose()
{
}
#endregion
#region Public-Methods
#endregion
#region Private-Methods
#endregion
}
绘制点
/// <summary>
/// 点类型图形
/// </summary>
public class PointGraphic : VMControls.RenderInterface.IPoint
{
/// <summary>
/// 点位置坐标
/// </summary>
public float CenterX{ get; set; }
/// <summary>
/// 点位置坐标
/// </summary>
public float CenterY{ get; set; }
/// <summary>
/// 点透明度
/// </summary>
public float Opacity{ get; set; }
/// <summary>
/// 点颜色设置, 系统属性
/// </summary>
public int Color{ get; set; }
/// <summary>
/// 点颜色设置
/// </summary>
public int FillColor{ get; set; }
/// <summary>
/// 点显示的粗细
/// </summary>
public float StrokeThickness{ get; set; }
/// <summary>
/// 颜色枚举
/// </summary>
public ColorConstants colorConstants
{
set
{
Color = (int)value;
FillColor = Color;
}
}
public PointGraphic()
{
colorConstants = ColorConstants.Green;
FillColor = Color;
StrokeThickness = 10;
Opacity = 1;
}
}
绘制线段
/// <summary>
/// 线段图形
/// </summary>
public class LineGraphic : VMControls.RenderInterface.ILine
{
/// <summary>
/// 线段起始点
/// </summary>
public float StartPointX{ get; set; }
/// <summary>
/// 线段起始点
/// </summary>
public float StartPointY{ get; set; }
/// <summary>
/// 线段结束点
/// </summary>
public float EndPointX{ get; set; }
/// <summary>
/// 线段结束点
/// </summary>
public float EndPointY{ get; set; }
/// <summary>
/// 线段透明度
/// </summary>
public float Opacity{ get; set; }
/// <summary>
/// 线段颜色设置
/// </summary>
public int Color{ get; set; }
/// <summary>
/// 线段颜色设置
/// </summary>
public int FillColor{ get; set; }
/// <summary>
/// 线段粗细
/// </summary>
public float StrokeThickness{ get; set; }
/// <summary>
/// 线段颜色设置
/// </summary>
public ColorConstants colorConstants
{
set
{
Color = (int)value;
FillColor = Color;
}
}
public LineGraphic()
{
colorConstants = ColorConstants.Green;
StrokeThickness = 10;
Opacity = 1;
}
}