浮云绘图2.0 开发手册 采集设备状态图、车站拓扑图等源码开发

1. 浮云绘图简介
浮云绘图是一款功能实用、操作简便,提供完整的SDK,支持二次开发的绘图项目。

浮云绘图通过线段、矩形、圆形、文字、图片等基础图形的绘制组合,可以满足诸多绘图场景的需要。

 

 

浮云绘图对外提供API接口,支持第三方工程控制图形的Line线条(颜色、宽度、虚实、端点)、Area区域(颜色、是否填充)、Text文字(内容、字体类型、字体大小、字体颜色)、Image图片(状态列表和状态值),并通过图形的Title、Name属性与业务对象关联,从而实时更新图形的展示效果。

 

 

2. 浮云绘图SDK开发包
浮云绘图提供完备的SDK,让绘图二次开发非常简单。包括:

A 绘图编辑器.exe

B 绘图组件dll和lib

C 绘图API Demo源码

D 绘图数据文件格式说明

2.1 浮云绘图二次开发流程

1使用浮云绘图编辑器.exe绘制图形 --> 2保存绘图数据文件 --> 3 创建第三方C#/VC等工程,集成FYDC.dll和AIP接口申明 --> 4调用接口函数读写绘图数据,显示图形、更新图形属性,关联业务对象。

 

 

2.2 浮云绘图编辑器.exe

浮云绘图编辑是一款功能强大的绘图编辑器,便捷实用。

A 支持线、方块、圆、文字、图片等基础图形绘制

B 支持撤销Ctrl+Z、重做Ctrl+D、剪切Ctrl+X、复制Ctrl+C、粘贴Ctrl+V等

C 支持对齐(左对齐、居中对齐、右对齐、顶部对齐...)、分布(水平、垂直)等

D 支持分层(置于顶层、上移一层、下移一层、置于底层)、分组(组合、打散)等

E 单独设置图形属性、批量设置属性

F 画布背景色、网格(线条模式、点集模式)、自动吸附对齐等

G 支持(鼠标中键)缩放(缩放比例、缩放因子)、滚动等

H 绘图数据文件打开、加载、保存等

 

 

2.3 数据存储格式

浮云绘图采用VC++实现,性能高、稳定性好,封装成绘图组件FYDC.dll。

绘图数据文件格式说明:

;;画布:画布宽,画布高,背景颜色
paper:0,0,16777215;

;;矩形图元:左,上,右,下,标题,名称,组id,线条颜色,线宽,虚实,是否填充,填充色,是否显示文本,文本内容,文本字体类型,字号,字体颜色
rectangle:226.000000,105.000000,374.000000,170.000000,标网站题Rect,矩形01,0,16711680,1,0,1,16777215,1,矩形Text,微软雅黑,10,16711680;

;;椭圆图元:左,上,右,下,标题,名称,组id,线条颜色,线宽,虚实,是否填充,填充色,是否显示文本,文本内容,文本字体类型,字号,字体颜色
ellipse:502.000000,114.000000,663.000000,210.000000,e,椭圆,0,0,1,0,1,16777215,1,椭圆Ell,微软雅黑,10,16711680;

;;线图元:左,上,右,下,标题,名称,组id,线条颜色,线宽,虚实,端点类型
line:276.000000,360.000000,399.000000,256.000000,,,0,0,3,0,0;

;;文本图元:左,上,右,下,标题,名称,组id,是否显示文本,文本内容,文本字体类型,字号,字体颜色
text:507.000000,310.000000,625.000000,364.000000,,,0,1,文字,微软雅黑,10,16711680,0;

;;图片图元:左,上,右,下,标题,名称,组id,,图片数目,状态值,状态图1,状态图2...
image:687.000000,321.000000,783.000000,417.000000,,,0,,3,0,F\fmaohao\浮云科技\浮云绘图\绘图配置\Image\cat1.png,F\fmaohao\浮云科技\浮云绘图\绘图配置\Image\cat2.png,F\fmaohao\浮云科技\浮云绘图\绘图配置\Image\cat3.png;

 

2.4 浮云绘图API Demo(C#版和VC版)

浮云绘图API使用Demo有C#版和VC版

下载 浮云绘图2.0APIDemo(VC版)

下载 浮云绘图2.0APIDemo(C#)

 

 

下面展示部分C#版接口申明

//组件接口
[DllImport("FYDC.dll", EntryPoint = "NewFYDC", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr NewFYDC();

[DllImport("FYDC.dll", EntryPoint = "CreateFYDC", CallingConvention = CallingConvention.Cdecl)]
public static extern void CreateFYDC(IntPtr canvas, IntPtr hParentWnd, int x, int y, int w, int h);

[DllImport("FYDC.dll", EntryPoint = "LoadShapes", CallingConvention = CallingConvention.Cdecl)]
public static extern void LoadShapes(IntPtr canvas, string fileName);

[DllImport("FYDC.dll", EntryPoint = "DeleteFYDC", CallingConvention = CallingConvention.Cdecl)]
public static extern void DeleteFYDC(IntPtr canvas);

// 图元对象
[DllImport("FYDC.dll", EntryPoint = "GetShapeCount", CallingConvention = CallingConvention.Cdecl)]
public static extern int GetShapeCount(IntPtr canvas);

[DllImport("FYDC.dll", EntryPoint = "GetShape", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetShape(IntPtr canvas, string type, string name);
[DllImport("FYDC.dll", EntryPoint = "GetShapeAt", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetShapeAt(IntPtr canvas, int index);

[DllImport("FYDC.dll", EntryPoint = "GetShapeTypeCount", CallingConvention = CallingConvention.Cdecl)]
public static extern int GetShapeTypeCount(IntPtr canvas, string type);


// 图元属性
[DllImport("FYDC.dll", EntryPoint = "GetShapeType", CallingConvention = CallingConvention.Cdecl)]
public static extern void GetShapeType(IntPtr shape, ref byte type);

[DllImport("FYDC.dll", EntryPoint = "GetShapeTitle", CallingConvention = CallingConvention.Cdecl)]
public static extern void GetShapeTitle(IntPtr shape, ref byte title);
[DllImport("FYDC.dll", EntryPoint = "SetShapeTitle", CallingConvention = CallingConvention.Cdecl)]
public static extern void SetShapeTitle(IntPtr canvas, IntPtr shape, string title);

[DllImport("FYDC.dll", EntryPoint = "GetShapeName", CallingConvention = CallingConvention.Cdecl)]
public static extern void GetShapeName(IntPtr shape, ref byte type);
[DllImport("FYDC.dll", EntryPoint = "SetShapeName", CallingConvention = CallingConvention.Cdecl)]
public static extern void SetShapeName(IntPtr canvas, IntPtr shape, string name);


[DllImport("FYDC.dll", EntryPoint = "SetBackColor", CallingConvention = CallingConvention.Cdecl)]
public static extern void SetBackColor(IntPtr canvas, int color);
[DllImport("FYDC.dll", EntryPoint = "GetBackColor", CallingConvention = CallingConvention.Cdecl)]
public static extern int GetBackColor(IntPtr canvas);
[DllImport("FYDC.dll", EntryPoint = "SetNoClientColor", CallingConvention = CallingConvention.Cdecl)]
public static extern void SetNoClientColor(IntPtr canvas, int color);

[DllImport("FYDC.dll", EntryPoint = "SetLineColor", CallingConvention = CallingConvention.Cdecl)]
public static extern void SetLineColor(IntPtr canvas, IntPtr shape, int color);
[DllImport("FYDC.dll", EntryPoint = "GetLineColor", CallingConvention = CallingConvention.Cdecl)]
public static extern int GetLineColor(IntPtr shape);

posted @ 2022-05-20 20:53  浮云绘图  阅读(17)  评论(1编辑  收藏  举报