PaintBucket
PaintBucket copied to clipboard
Want to fill colour in touch but fill on different place
Hi
I am making app where user can able to fill colour. App is auto layout and image is on full screen and user can fill colour by tapping on image.
But when i use touchbegan method for getting user points and then passing these points in your method, result was fill colour on different place please check image
my touch began method is
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { let touch = touches.first! let location = touch.location(in: self.imgViewMain) print(location.x) print(location.y)
self.imgViewMain.image = self.imgViewMain.image?.pbk_imageByReplacingColorAt(Int(location.x), Int(location.y), withColor: .yellow, tolerance: 100, antialias: true)
}
Can you please sort out where i am doing this wrong
Hi, Did you got solution for this issue, Since I am also looking for same.
Yes
its working perfectly on FullScreen Image. Change your image frame with view frame (full screen without navigation bar).