iphone - Monotouch add border to gradient -
i trying add borders gradient button:
var c = bdpencil.colormain; context.setlinewidth(bdpencil.width); context.setstrokecolor(c.r, c.g, c.b, c.a); context.clip(); cgcolorspace colorspace = cgcolorspace.createdevicergb(); cggradient gradient = new cggradient(colorspace, colors, new float[]{ 0, 1 }); context.drawlineargradient(gradient, new pointf((float)r.centerx, (float)r.top), new pointf((float)r.centerx, (float)r.bottom), cggradientdrawingoptions.drawsafterendlocation); context.restorestate(); and not working. working if same thing solid color:
var c = bdpencil.colormain; context.setlinewidth(bdpencil.width); context.setstrokecolor(c.r, c.g, c.b, c.a); var g = bgpencil.colormain; context.setfillcolor(g.r, g.g, g.b, g.a); context.drawpath(cgpathdrawingmode.fillstroke); when trying stroke path after drawlineargradinet nothing happens. suppose need gradientstroke can't find it.
any idea why?
the mistake tried doing context. drew path, stroked , drew gradient , worked.
Comments
Post a Comment