主程序
* 1. 加载并显示图片 * * * * * * * * * * * * * * * * * * * * * * * * *
read_image ( Image , dev_get_window ( WindowHandle)
set_display_font ( WindowHandle, 14 ,
dev_set_draw (
dev_set_line_width ( 3 )
dev_display ( Image ) * 读取字典文件 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 存储设置坐标
DictPath : = * 字典文件是否存在
file_exists ( DictPath, FileExists)
if ( FileExists) * 读取字典文件read_dict ( DictPath, [], [], DictHandle)
else * 创建字典文件create_dict ( DictHandle) * 设置初始化区域set_dict_tuple ( DictHandle,
endif* 获取设置 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 获取初始化设置区域参数
get_dict_tuple ( DictHandle, * 获取用户设置的参数
GetDrawRectAOI ( DisplayRegion, InitRect, WindowHandle, OutRect) * 将设置写入字典 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
set_dict_tuple ( DictHandle,
* 结果保存到字典文件
write_dict ( DictHandle, DictPath, [], []) * 显示结果 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
dev_display ( Image )
dev_display ( DisplayRegion)
子程序(GetDrawRectAOI )
* 创建绘制矩形
create_drawing_object_rectangle1 ( InitRect[0 ], InitRect[1 ], InitRect[2 ], InitRect[3 ], \DrawRect)
* 设置颜色
set_drawing_object_params ( DrawRect,
* 添加编辑框到窗口
attach_drawing_object_to_window ( WindowHandle, DrawRect) * 调整Rect矩形
stop ( ) * 获取设置的矩形参数
get_drawing_object_params ( DrawRect, [
* 从窗口中删除编辑框
detach_drawing_object_from_window ( WindowHandle, DrawRect) * 生成矩形区域
gen_rectangle1 ( Rectangle, OutRect[0 ], OutRect[1 ], OutRect[2 ], OutRect[3 ])
return ( )