首页 > 其他分享 >基本操作之——Object移除操作

基本操作之——Object移除操作

时间:2024-03-07 10:13:41浏览次数:21  
标签:obj Object window dev 移除 TiledImage 基本操作 ImagesReduced remove

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', [], [])

标签:obj,Object,window,dev,移除,TiledImage,基本操作,ImagesReduced,remove
From: https://www.cnblogs.com/echo-efun/p/18058257

相关文章

  • 基本操作之——Object差异
    obj_diff—Calculatethedifferenceoftwoobjecttuples.计算两个对象的差异*region类型获取内容差异*image类型/XLDs类型仅比较内存地址差异*mixed类型(如image和xld的混合类型)**obj_diff使用read_image(Image,'particle')threshold(Image,Regio......
  • 基本操作之——Object插入
    insert_obj—Insertobjectsintoaniconicobjecttuple.  插入对象到图标对象数组中*以下实例展示了,在垂直两张图像中,插入一张蓝莓图像dev_update_off()dev_close_window()dev_open_window(0,0,640,480,'white',WindowHandle)set_display_font(WindowHandle,1......
  • 基本操作之——Object比较
    *此示例程序显示了运算符compare_obj的用法。*特别是,它显示了compare_obj和test_equal_obj之间的区别,compare_obj比较对象的实际内容,而test_equal_obj比较图像和XLD在内存中的位置。*compare_obj——比较实际内容是否一致*test_equal_obj——比较内存地址是否一致(当......
  • 基本操作之——tuple增删查改操作
    1.tuple增加操作——tuple_insertOriginalTuple:=[0,1,2,3,4,5]*指定索引处插入一个元素tuple_insert(OriginalTuple,3,'x',InsertSingleValueA)*HDevelop执行同样操作InsertSingleValueB:=insert(OriginalTuple,3,'x') **指定索引处插入多个元素tuple_insert(Or......
  • 基本操作之——tuple类型
    *此示例演示如何使用运算符tuple_type,*tuple_is_int、tuple_is_real、tuple_is_string、*tuple_is_mixed和元素运算符*tuple_type_elem、tuple_is_int_elem、tuple_is_real_elem、*和tuple_is_string_elem。*此外,此示例还演示了如何使用强制转换(例如tuple_int)优化元组以加......
  • Python list列表pop弹出内容del移除内容结果不对错误
    前言全局说明Pythonlist列表pop弹出内容del移除内容结果不对一、功能需求一个list列表,内容是1-9,用for循环打印,打印过的值,从列表中删除二、输出结果不对,代码有问题文件名:test.py#!/usr/bin/envpython3#coding:UTF-8#-*-coding:UTF-8-*-lists_1=['a','b']......
  • 记录一次WPF命令参数报错,InvalidCastException: T for DelegateCommand<T> is not an
    在使用WPF的时候对int或者bool类型进行绑定出现InvalidCastException:TforDelegateCommandisnotanobjectnorNullable.<ButtonWidth="200"Height="30"Content="按钮"Command="{BindingOpenCommand}"CommandParameter="{Binding......
  • 代码随想录算法训练营第一天| 704. 二分查找、27. 移除元素。
    704.二分查找https://leetcode.cn/problems/binary-search/description/一、左闭右闭`//左闭右闭publicstaticinterFen1(int[]nums,inttarget){if(target<nums[0]||target>nums[nums.length-1]){return-1;}intmaxIndex=nums.length-......
  • java.lang.reflect.InaccessibleObjectException
    低版本springboot应用使用高版本JDK报以下异常:Causedby:java.lang.reflect.InaccessibleObjectException:Unabletomakeprotectedfinaljava.lang.Classjava.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)throwsjava......
  • 基本操作之——正则表达式
    1.定义*允许0次或多次重复+允许1次或多次重复?允许0次或1次重复{n,m}允许n到m次重复{n}允许n次重复^ 匹配字符串开头$ 匹配字符串结尾.匹配除换行符外所有字符2.事例*正则表达式基本操作tuple_regexp_match('abba','ab*',Match......