1.默认参数设置
Text := '默认显示第一行'
Text[1] := '默认显示第二行'
Text[2] := '默认显示第三行'
dev_disp_text (Text, 'window', 12, 12, 'black', [], [])
2.设置行、列值
dev_disp_text ('Row = 100\nColumn = 60\nColor = \'black\'', 'window', 100, 60, 'black', [], [])
3.dev_disp_text ('Row = \'center\',\nColumn = \'right\'\nColor = \'red\'', 'window', 'center', 'right', 'red', [], [])
4.dev_disp_text ('Row = 372.7\nColumn = \'center\'\nColor = \'blue\'', 'window', 372.7, 'center', 'blue', [], [])
5.文本每一行设置不同颜色
dev_disp_text ('Row = \'bottom\'\nColumn = \'left\'\nColor = [\'magenta\', \'orange\', \'black\']', 'window', 'bottom', 'left', ['magenta','orange','black'], [], [])
6.不显示底框
dev_disp_text ('不显示底框\n\'box\' = \'false\'', 'window', 200, 40, 'black', 'box', 'false')
7.底框背景色设置
dev_disp_text ('底框背景色\n\'box_color\' = \'sky blue\'', 'window', 300, 40, 'black', 'box_color', 'sky blue')
8.底框背景色16进制格式方式设置(16进制方式设置颜色,可通过最后两位来设置颜色的透明度)
dev_disp_text ('底框背景色16进制格式方式设置\n\'box_color\' = \'#ff8d2644\'', 'window', 340, 40, 'black', 'box_color', '#f28d2644')
9.底框圆弧度设置
dev_disp_text ('底框圆弧度设置\n\'border_radius\' = 0', 'window', 200, 400, 'black', 'border_radius', 0)
dev_disp_text ('底框圆弧度设置\n\'border_radius\' = 10', 'window', 240, 400, 'black', 'border_radius', 10)
10.padding设置
dev_disp_text ('padding设置\n\'box_padding\' = 0', 'window', 320, 400, 'black', 'box_padding', 0)
dev_disp_text ('padding设置\n\'box_padding\' = 10', 'window', 400, 400, 'black', 'box_padding', 10)
11.阴影设置
dev_disp_text ('\'shadow\' = \'false\'', 'window', 200, 40, 'black', 'shadow', 'false')
* 'shadow_color': set the shadow color.
dev_disp_text ('\'shadow_color\' = \'green\'', 'window', 300, 40, 'black', 'shadow_color', 'green')
* 'shadow_color': it is valid to use colors with an alpha value (rgba)
* to display transparent shadows.
dev_disp_text ('\'shadow_color\' = \'#f28d2688\'', 'window', 340, 40, 'black', 'shadow_color', '#f28d2688')
* 'shadow_sigma': set the blurring of the shadow.
dev_disp_text ('\'shadow_sigma\' = 0', 'window', 200, 400, 'black', 'shadow_sigma', 0)
dev_disp_text ('\'shadow_sigma\' = 2.5', 'window', 240, 400, 'black', 'shadow_sigma', 2.5)
* 'shadow_dx', 'shadow_dy': set the offset of the shadow.
dev_disp_text ('\'shadow_dx\' = -5, \'shadow_dy\' = -3', 'window', 300, 400, 'black', ['shadow_dx','shadow_dy'], [-5,-3])
dev_disp_text ('\'shadow_dx\' = 3, \'shadow_dy\' = -3', 'window', 340, 400, 'black', ['shadow_dx','shadow_dy'], [3,-3])
12.以图像坐标系来显示文本
read_image (Image, 'clip')
dev_resize_window_fit_image (Image, 0, 0, 1024, 768)
binary_threshold (Image, Region, 'max_separability', 'dark', UsedThreshold)
connection (Region, ConnectedRegions)
select_shape (ConnectedRegions, SelectedRegions, 'area', 'and', 5000, 99999)
dev_display (Image)
dev_set_colored (12)
dev_display (SelectedRegions)
area_center (SelectedRegions, Area, Row, Column)
* Display the results in image coordinates. The position of this text is
* automatically adapted if the displayed iconic objects are moved or
* scaled.
dev_disp_text ('Area: ' + Area, 'image', Row, Column, 'black', 'box_color', '#ffffff77')
标签:disp,text,dev,window,black,shadow From: https://www.cnblogs.com/echo-efun/p/18048584