objective c - How to implement the color wheel inside the UIView? -


i searched web site, , found how draw color wheel... math behind colour wheel

but implement drawing on uiview. how can using quartz technology? should draw dots or lines? thank you

maybe use you.

  1. cgcontext*** functions draw dots or lines, , uigraphicsgetimagefromcurrentimagecontext uiimage item.

-(void) drawpoint:(cgpoint)point { cgcontextbeginpath(uigraphicsgetcurrentcontext()); cgcontextmovetopoint(uigraphicsgetcurrentcontext(), point.x, point.y); cgcontextaddlinetopoint(uigraphicsgetcurrentcontext(), point.x, point.y); cgcontextstrokepath(uigraphicsgetcurrentcontext()); }

-(void) drawlinefrom:(cgpoint)start to:(cgpoint)end { cgcontextbeginpath(uigraphicsgetcurrentcontext()); cgcontextmovetopoint(uigraphicsgetcurrentcontext(), start.x, start.y); cgcontextaddlinetopoint(uigraphicsgetcurrentcontext(), end.x, end.y); cgcontextstrokepath(uigraphicsgetcurrentcontext()); }

  1. draw uiimage uiview. uicolor* backcolor = [uicolor colorwithpatternimage:your_image_from_cgcontext]; view.backgroundcolor = backcolor;

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -