iphone - Resize drawing animation from given CGPoints? -
i have iphone version of app draws lines on screen cgpoints stored in core data. of drawings line based without fill, draws line given point next point etc.
now making ipad version , want use same points (the points collected function build tracking screen , lot of work wish reuse same points have).
does body has idea, algorithm or function drawing same lines' same points x2 size ?
that draw method:(took glpaint example of apple)
- (void) playback:(nsnumber*)index { if (p==0) { pointscount=[[localpoints objectatindex:[index intvalue]] count]-1; } isplaybackon = yes; letterpoint *point1 = (letterpoint*)[[localpoints objectatindex:[index intvalue]] objectatindex:p]; cgpoint p1 = cgpointfromstring(point1.float_point); letterpoint *point2 = (letterpoint*)[[localpoints objectatindex:[index intvalue]] objectatindex:p+1]; cgpoint p2 = cgpointfromstring(point2.float_point); [self renderlinefrompoint:p1 topoint:p2]; p++; if(p<pointscount){ [self performselector:@selector(playback:) withobject:index afterdelay:0.03]; }else { p=0; isplaybackon = no; } }
thanks
shani
create affine transform matrix scale factor of 2.0
(and possibly translation if want move origin of drawing). apply transform every point cgpointapplyaffinetransform()
, use resulting points drawing.
Comments
Post a Comment