ios - Generate a CGPath from another path's line width outline -


i might not explaining in best way possible, please bear me.

what have drawn cgpath on top of mkmapview object:

the way able achieve create cgpath darker blue line, create copy of path, , stroke thicker version of semi-transparent blue color. here's code i'm using this:

    // set shadow around path line     cgcontextref context = uigraphicsgetcurrentcontext();     cgcontextsavegstate(context);     cgcontextsetrgbstrokecolor(context, 0.0f, 0.0f, 0.0f, 0.0f);     cgcontextsetrgbfillcolor(context, 0.0f, 0.0f, 1.0f, 0.4f);     cgpathref shadowpath = cgpathcreatecopybystrokingpath(self.path.cgpath, null, 80.0f, kcglinecapround, kcglinejoinround, 0.0f);     cgcontextbeginpath(context);     cgcontextaddpath(context, shadowpath);     cgcontextdrawpath(context, kcgpathfillstroke);     cgcontextrestoregstate(context);     cgpathrelease(shadowpath); 

works pretty well, nothing wrong far.

however, though cgpathref of outline of thicker semi-transparent blue area. here's screenshot showing pseudo-path want out of (hand drawn in red):

how possible?

simple: use cgpathcreatecopybystrokingpath. pass in wide line width, , cap of kcglinecapround.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -