I'm not expecting a very detailed answer here but just to be pointed in the right direction.
Let's say i wanted to make a drawing program like microsoft paint or the app draw something, how can i do this?
Do I basicly set colors on pixels and nearby pixels (for thickness) when I hover and click with the mouse?
I'm planning to make an app that requires the users to draw stuff in a simple manner, so any suggestions would be much appriciated :)
Best of regards, Alexander
UIBezierPath
is the good option for drawing the lines on yourUIView
.For Drawing you need a custom View You can't draw on a UIViewController.And use touch delegate methods for drawing lines.
declare an
UIBezierPath *bezierPath;
in .h filesetNeedsDisplay
will call yourdrawRect:
method.And you can change Storke color using
setStroke:
property.For complete idea gone through UIBezierPath class reference. Hope this help's youtry this demo for your application
http://code4app.net/ios/Paint-Pad/4fcf74876803faec66000000
https://www.cocoacontrols.com/controls/smooth-line-view
https://www.cocoacontrols.com/controls/acedrawingview
https://www.cocoacontrols.com/controls/mgdrawingslate
it may help you.