基本操作之——Object移除操作
remove_obj — Remove objects from an iconic object tuple. 从图形数组中移除对象
*
* This example demonstrates various use cases for the remove_obj operator.
*此示例演示了 remove_obj 运算符的各种用例
*
dev_update_off ()
dev_close_window ()
dev_open_window (0, 0, 640, 480, 'black', WindowHandle)
set_display_font (WindowHandle, 16, 'mono', 'true', 'false')
*
* Load images of Apples, Berries, Carrots and Potatoes.
read_image (ImagesAll, ['food/vegetables/apple_1','food/vegetables/blueberry_1','food/vegetables/carrot_1','food/vegetables/potato_1'])
*
* There are four objects in the iconic array.
tile_images (ImagesAll, TiledImagesAll, 1, 'vertical')
dev_display (TiledImagesAll)
dev_disp_text ('There are four objects in the iconic array.', 'window', 'top', 'left', 'black', [], [])
stop ()
*
* Remove the carrots (array element 3) from original.
remove_obj (ImagesAll, ImagesReduced, 3)
tile_images (ImagesReduced, TiledImage, 1, 'vertical')
dev_display (TiledImage)
dev_disp_text ('Removed the Carrots (array element 3) from original.', 'window', 'top', 'left', 'black', [], [])
stop ()
*
* Remove Carrots, Potatoes and Apples (Elements 1, 3, and 4).
remove_obj (ImagesAll, ImagesReduced, [1,3,4])
tile_images (ImagesReduced, TiledImage, 1, 'vertical')
dev_display (TiledImage)
dev_disp_text ('Removed Carrots, Potatoes and Apples (Elements 1, 3 and 4).', 'window', 'top', 'left', 'black', [], [])
stop ()
*
* Remove_obj is tolerant against duplicates.
*Remove_obj对重复行为持宽容态度
remove_obj (ImagesAll, ImagesReduced, [3,2,2,3,3])
tile_images (ImagesReduced, TiledImage, 1, 'vertical')
dev_display (TiledImage)
dev_disp_text (['remove_obj is tolerant against duplicates.','Removed Carrots and Blueberries with Index [3,2,2,3,3].'], 'window', 'top', 'left', 'black', [], [])
stop ()
*
* Remove none of the objects.
remove_obj (ImagesAll, ImagesReduced, [])
tile_images (ImagesReduced, TiledImage, 1, 'vertical')
dev_display (TiledImage)
dev_disp_text ('Remove none of the objects.', 'window', 'top', 'left', 'black', [], [])
stop ()
*
* 移除所有对象
remove_obj (ImagesAll, ImagesReduced, [1,2,3,4])
tile_images (ImagesReduced, TiledImage, 1, 'vertical')
dev_clear_window ()
dev_display (TiledImage)
count_obj (ImagesReduced, RemainCount)
dev_disp_text ('Removed all objects, there are ' + RemainCount + ' remaining objects', 'window', 'top', 'left', 'black', [], [])
------------------------------------
承接
**视觉检测软件开发及调试
**工业软件开发
**上位机软件开发
wechat:luoran2024
qq:565934058
email:taoyuansu@qq.com
海量教育资源及影视资源下载
微信公众号:EFun科技
------------------------------------
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!