我正在尝试着色应用程序并找出目标c中的任何人之前做过的填充物.???我正在读取图片中的所有像素数据,我也可以更改它..但是洪水填充只能做我想要的..
..在这里我可以识别包含黑点的像素.但我真的很混淆如何识别特定白色区域中的像素.非常感谢...
我的JSON数据
{
"addon_items" : [
{
"aname" : "",
"id" : "2588",
"name" : "Plain Nan",
"order" : "1",
"aid" : "259",
"Sub_Add_Items" : "",
"icon" : "",
"status" : "1",
"next" : "0",
"price" : "0.60"
},
{
"aname" : "",
"id" : "2589",
"name" : "Pitta Bread",
"order" : "2",
"aid" : "259",
"Sub_Add_Items" : "",
"icon" : "",
"status" : "1",
"next" : "0",
"price" : "0.00"
}
],
"addon" : {
"description" : "Please choose your …Run Code Online (Sandbox Code Playgroud) 我有以下按钮,它们会根据某些条件动态添加。现在,我需要将所有添加的按钮行为更改为单选按钮。这样我就可以根据选择执行一些操作。
var posX = 0
var posY = 0
if trim.contains("0"){
print("contaim 0")
let button1 = UIButton(frame: CGRect(x: posX, y: posY, width: 60, height: 20))
button1.setTitleColor(UIColor.blackColor(), forState: .Normal)
button1.setTitle("No", forState: .Normal)
button1.setImage(UIImage(named: "checkbox untick.png")!, forState: .Normal)
button1.addTarget(self, action: #selector(buttonAction), forControlEvents: .TouchUpInside)
myStackview.addSubview(button1)
posX = 60
}
if trim.contains("1") {
print("contaim 1")
let button2 = UIButton(frame: CGRect(x: posX, y: posY, width: 60, height: 20))
button2.setTitleColor(UIColor.blackColor(), forState: .Normal)
button2.setTitle("Less", forState: .Normal)
button2.setImage(UIImage(named: "checkbox untick.png")!, forState: .Normal)
button2.addTarget(self, action: #selector(buttonAction), forControlEvents: .TouchUpInside)
myStackview.addSubview(button2) …Run Code Online (Sandbox Code Playgroud) swift ×2
alamofire ×1
flood-fill ×1
ios ×1
iphone ×1
json ×1
objective-c ×1
radio-button ×1
swifty-json ×1