SwiftyDraw
SwiftyDraw copied to clipboard
I want to draw line with image pattern.
How are you? I am going to draw line with image pattern.
How can I do for this? Could you guide me how can I do?
Thank you.
Sorry, I'm not sure what you mean. Can you try to explain please?
Thank you for your answer.
When draw line, you used this at 163 line of SwiftyDraw.swift file
override open func draw(_ rect: CGRect) {
super.draw(rect)
guard let context: CGContext = UIGraphicsGetCurrentContext() else { return }
for item in drawItems {
context.setLineCap(.round)
context.setLineJoin(.round)
context.setLineWidth(item.brush.width)
context.setBlendMode(item.brush.blendMode.cgBlendMode)
context.setAlpha(item.brush.opacity)
if (item.isFillPath)
{
context.setFillColor(item.brush.color.uiColor.cgColor)
context.addPath(item.path)
context.fillPath()
}
else {
context.setStrokeColor(item.brush.color.uiColor.cgColor)
context.addPath(item.path)
context.strokePath()
}
}
}
Then it will draw line. But I want to line using some image pattern. I didn't find any solution yet. So I need your help.
Thank you.
draw line with image pattern.
Have you found a solution to this demand?