Vector images?

Mark Waddingham mark at livecode.com
Wed Oct 21 10:58:44 EDT 2015


On 2015-10-21 16:53, Terence Heaford wrote:
>> On 21 Oct 2015, at 10:28, Mark Waddingham <mark at livecode.com> wrote:
>> 
>>  It is very similar to CoreGraphics (but actually has a number of 
>> features beyond which CG offers). e.g.
>>     MCGContextCreate(-> myContext)
>>     MCGContextSetRGBAFillColor(myContext, 1, 0, 0, 0.5)
>>     MCGContextAddRectangle(myContext, [0, 0, 400, 400])
>>     MCGContextFill(myContext)
> 
> 
> Does this not do it? or similar?
> 
> -(void) drawRect: (CGRect) rect
> {
>     CGContextRef context = UIGraphicsGetCurrentContext();
> 
>     UIColor * redColor = [UIColor colorWithRed:1.0 green:0.0 blue:0.0
> alpha:1.0];
> 
>     CGContextSetFillColorWithColor(context, redColor.CGColor);
> 
>     CGContextFillRect(context, self.bounds);
> }
> 

Yes - that would be the CG API version of the LibGraphics API - I did 
say it was similar :)

I wasn't suggesting that ssmple code example was an example of features 
LibGraphics has which CoreGraphics does not (although I can see how it 
could be read like that - oops).

LibGraphics incorporates various features relating to bitmap effects in 
its API. CoreGraphics only has 'drop-shadow' abilities - LibGraphics 
does the whole stack of bitmap effects you see exposed via the 
bitmapEffects property. It also has a number of gradient types which 
CoreGraphics does not support.

Eventually LibGraphics will (hopefully) have APIs added to enable the 
range of filter processing operations SVG allows - in order to expand 
SVG support in the future (again, something CoreGraphics does not have).

Warmest Regards,

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list