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

c# - IMAP GMAIL getting folder list problem -

PHP proxy to get XML: problem with URL arguments -