PaintBucket icon indicating copy to clipboard operation
PaintBucket copied to clipboard

Want to fill colour in touch but fill on different place

Open waseemSuave opened this issue 6 years ago • 2 comments

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 untitled

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

waseemSuave avatar May 03 '18 13:05 waseemSuave

Hi, Did you got solution for this issue, Since I am also looking for same.

AnilkumarRabhasa avatar Sep 08 '18 18:09 AnilkumarRabhasa

Yes

its working perfectly on FullScreen Image. Change your image frame with view frame (full screen without navigation bar).

waseemSuave avatar Sep 10 '18 04:09 waseemSuave