Swift - Fix print issue and pass variables to a class to finish drawing

已完成 已发布的 3 年前 货到付款
已完成

My code needs two fix:

1) It is not printing within the functional call

2) pass the variable so the class can draw correctly

Code sample below

public func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {

print ("my test")

var x1 = 50

let y1 = 100

let x2 = 10

let y2 = 10

let x3 = 200

let y3 = 200

let x4 = 350

let y4 = 100

}

class DrawView: UIView {

override func draw(_ rect: CGRect) {

let context = UIGraphicsGetCurrentContext()

context?.setLineWidth(10.0)

context?.setStrokeColor([login to view URL])

context?.move(to: CGPoint(x: x1, y: y1))

context?.addLine(to: CGPoint(x: x2, y: y2))

context?.strokePath()

let context2 = UIGraphicsGetCurrentContext()

context2?.setLineWidth(10.0)

context2?.setStrokeColor([login to view URL])

context2?.move(to: CGPoint(x: x3, y: y3))

context2?.addLine(to: CGPoint(x: x4, y: y4))

context2?.strokePath()

}

}

Swift iPhone iPad Cocoa

项目ID: #27995771

关于项目

2个方案 远程项目 活跃的3 年前

授予:

ethanblount1

Hi, there Q:Which data are you capturing now from the camera? Q: Did you use Vision Image? I want to know about capturing data at first Thank you Ethan Blount

$25 USD / 小时
(2条评论)
2.7

有2名威客正在参与此工作的竞标,均价$23/小时

harshthakur23

hello 1) are you sure, below function is being called , so that it can print whatever needed? check with breakpoints. I thik this delegate method you called is wrong. let me check code for this once public func capt 更多

$20 USD / 小时
(3条评论)
1.5