使用右上角的选项卡切换到不同的编程语言。

使用右上角的选项卡切换到不同的编程语言。

使用右上角的选项卡切换到不同的编程语言。

使用右上角的选项卡切换到不同的编程语言。

dev_set_drawdev_set_drawDevSetDrawDevSetDrawdev_set_draw开发设置画(算子)

名称

dev_set_drawdev_set_drawDevSetDrawDevSetDrawdev_set_draw — 定义区域填充模式。

签名

dev_set_draw( : : DrawMode : )

Herror dev_set_draw(const char* DrawMode)

Herror T_dev_set_draw(const Htuple DrawMode)

void DevSetDraw(const HTuple& DrawMode)

static void HWindow::DevSetDraw(const HString& DrawMode)

static void HWindow::DevSetDraw(const char* DrawMode)

static void HWindow::DevSetDraw(const wchar_t* DrawMode)   ( Windows only)

static void HOperatorSet.DevSetDraw(HTuple drawMode)

static void HWindow.DevSetDraw(string drawMode)

def dev_set_draw(draw_mode: str) -> None

描述

dev_set_drawdev_set_drawDevSetDrawDevSetDrawDevSetDrawdev_set_draw 用于定义区域的填充模式。如果 DrawModeDrawModeDrawModeDrawModedrawModedraw_mode 设置为 'fill'"fill""fill""fill""fill""fill",则区域将以填充形式显示;如果设置为 'margin'"margin""margin""margin""margin""margin",则仅显示轮廓。在 'margin'"margin""margin""margin""margin""margin" 模式下,轮廓的外观可通过 dev_set_line_widthdev_set_line_widthDevSetLineWidthDevSetLineWidthDevSetLineWidthdev_set_line_widthset_line_styleset_line_styleSetLineStyleSetLineStyleSetLineStyleset_line_style 进行调整。

更多信息请参阅算子 set_drawset_drawSetDrawSetDrawSetDrawset_draw 的说明。不过,与该算子不同的是,此绘制模式也会应用于之后打开的所有新图形窗口。

注意

使用 HDevelop 的代码导出功能时,为该算子生成的代码的行为可能与相关的 HALCON 算子有所不同。有关 HDevelop 图形算子导出到不同编程语言的详细说明,请参阅 “HDevelop 用户指南” 中的 代码导出 -> 代码生成的通用方面 -> 图形窗口 一章。

参数

DrawModeDrawModeDrawModeDrawModedrawModedraw_mode (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

区域输出的填充模式。

默认值: 'fill' "fill" "fill" "fill" "fill" "fill"

值列表: 'fill'"fill""fill""fill""fill""fill", 'margin'"margin""margin""margin""margin""margin"

示例(HDevelop)

read_image(Image,'monkey')
threshold(Image,Region,128,255)
dev_clear_window ()
dev_set_color('red')
dev_set_draw('fill')
dev_display(Region)
dev_set_color('white')
dev_set_draw('margin')
dev_display(Region)

结果

如果指定参数的值正确,dev_set_drawdev_set_drawDevSetDrawDevSetDrawDevSetDrawdev_set_draw 返回 2 (H_MSG_TRUE)。否则,将抛出一个异常并返回错误代码。

可能的后继

dev_set_line_widthdev_set_line_widthDevSetLineWidthDevSetLineWidthDevSetLineWidthdev_set_line_width, dev_displaydev_displayDevDisplayDevDisplayDevDisplaydev_display

另见

set_drawset_drawSetDrawSetDrawSetDrawset_draw

模块

基础