set_drawing_object_callbackadds the callback functionCallbackFunctionto be called on the event(s) defined inDrawObjectEventto the drawing objectDrawHandle. An event is an action, i.e., a user interaction with the mouse or a call to a HALCON operator, e.g.,attach_drawing_object_to_window...
这里的关键是HTuple callbackFunction是指向HDrawingObject.HDrawingObjectCallback类型的委托的函数指针。
set_drawing_object_callback— Add a callback function to a drawing object.Signatureset_drawing_object_callback( : : DrawID, DrawObjectEvent, CallbackFunction : )Descriptionset_drawing_object_callback adds the callback function CallbackFunction to be called on the event(s) defined in Draw...
obj.SetDrawingObjectCallback("on_resize",(void*)CallBackFunc_DrawObj); obj.SetDrawingObjectCallback("on_drag",(void*)CallBackFunc_DrawObj); // obj.SetDrawingObjectCallback("on_attach",CallBackFunc_Set); obj.SetDrawingObjectCallback("on_select",(void*)CallBackFunc_Set); // AttachDrawing...
147. detach_drawing_object_from_window( : : WindowHandle, DrawID : ) 将现有的图形对象从halcon窗口分离。 绘图对象将不再显示在窗口中。然而,除非调用clear_drawing_object,不然绘图对象仍然存在。 如果通过set_drawing_object_callback传递 'on_detach' ,调用回调函数绘制对象,也要进行清除工作 ...
参考Halcon中关于SetDrawingObjectCallback函数的描述,需要在c++下面调用时,调用C++格式的函数,即下图的Void的回调函数指针。 回调函数.PNG 但是这个回调函数在程序中需要定义为一个全局函数,主要依据是Halcon中介绍,如下: 回调函数要求.PNG 所以根据这些需求完成Halcon窗口中绘制矩形、圆形和直线的操作 ...
set_drawing_object_callback 实例 dev_close_window () dev_open_window (0, 0, 512, 512, 'black', WindowHandle) read_image(ImageGB, '1.jpg') dev_clear_window () attach_background_to_window (ImageGB,WindowHandle ) read_image (Image, 'printer_chip/printer_chip_01') ...
private void CallbackOnSelect(HDrawingObject drawid, HWindow window, string type){ hDrawingObject....
RoiRec.OnDrag(HDrawingObjectCallbackClass f); RoiRec.OnResize(HDrawingObjectCallbackClass f); 回调函数用来确定新的ROI位置和大小,也就是更新现在的ROI状态 var valueTuple = drawid.GetDrawingObjectParams(nameTuple); roi.DrawingObjectDatas = valueArray; ...
calibration_object */ #define H_ERR_SOL_INVALID_CALIB_OBJECT 3784 /* Invalid calibration object */ #define H_ERR_SOL_NO_CALIB_OBJECT_SET 3785 /* No calibration object set */ #define H_ERR_SOL_WR_FILE_FORMAT 3786 /* Invalid file format for sheet-of-light model */ #define H_ERR...