[futurebasic] Re: [FB] Help on Pasteboard.h

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2009 : Group Archive : Group : All Groups

From: Deep <Info@...>
Date: Wed, 07 Jan 2009 00:27:09 +0000
> Deep - this can be clearly seen in gdb if you're wondering if Robert
> intuited this.

Yes, was wondering about how he pin-pointed it so accurately! Will have to
look into the gdb.

> CG is visited very briefly in my own code and there is a lot to learn.
> QuickDraw has been dead for years folks. CG is THE  path for a
> Quickdraw replacement in FB. Apple may drag Quickdraw along for a
> while but don't count on it ( tangentially, Rosetta is apparently
> optional in OS X 10.6 ) . Also, Quickdraw-drawn graphics look like
> total garbage compared to CG-drawn graphics in OS X.

CoreGraphics is amazing in its flexibility once the basics are mastered.
With help from Robert in his other post, it was the missing Begin/End
statements for the PDFContext that caused the crash. Now that those two
missing lines are in place, it works! The transparency, smooth
anti-aliasing, and re-usable images for controls, pasteboard, printing, PDF
files, etc, is worth the effort of migrating.




> From: Brian Stevens <bstevens33@...>
> Reply-To: <futurebasic@...>
> Date: Mon, 5 Jan 2009 22:17:15 -0700
> To: <futurebasic@...>
> Subject: Re: [FB] Help on Pasteboard.h
> 
> 
> On Jan 5, 2009, at 6:56 PM, Robert Purves wrote:
> 
>> 
>> Deep wrote:
>> 
>>> Still working on the Pasteboard and have tried to make a function
>>> where a
>>> CoreGrpahics PDFContext is built and then the imagery is placed on
>>> the
>>> pasteboard ready to move to another application.
>>> 
>>> The conceptual part of the syntax has come from
>>> QuickDrawToQuartz2D.pdf
>>> taking advantage of not using the callback to make it easier as
>>> callback is
>>> not needed (see "promised data"). Unfortunately, it crashes where
>>> marked. It
>>> could be the "#define" stuff perhaps?
>> 
>> 
>> It crashes in CGContextStrokePath().
> 
> Deep - this can be clearly seen in gdb if you're wondering if Robert
> intuited this.
> 
> 
>> To avoid the crash you need to bracket your CG drawing between
>> CGContextBeginPage() and CGContextEndPage().
> 
> Ah ha!  Didn't know that pdfs are treated as 'pages' and require this.
> Looking at PDFContext just prior to the CGContextStrokePath call it
> seemed to have a valid address with no warnings from gdb ( i.e.
> "invalid" etc. ). The only thing that looked suspicious ( and this is
> pretty thin ) was PDFContext and MyConsumer had the same address just
> prior to the CGContextTranslateCTM. Clearly Robert had the knowledge
> ( or did the research ) to uncover the salient points of processing a
> PDFContext.
> 
> Thanks to Deep for the demo and to Robert for the lesson.
> 
> CG is visited very briefly in my own code and there is a lot to learn.
> QuickDraw has been dead for years folks. CG is THE  path for a
> Quickdraw replacement in FB. Apple may drag Quickdraw along for a
> while but don't count on it ( tangentially, Rosetta is apparently
> optional in OS X 10.6 ) . Also, Quickdraw-drawn graphics look like
> total garbage compared to CG-drawn graphics in OS X.
> 
> For those looking for online tutorial references ( besides the Apple
> docs which are good ), the following link is a decent article ( by
> Scott Thompson ) and it has an embedded link in it to his 'previous
> article' -----both on Quartz 2D. Scott explains code-independent
> concepts well and we all need this before trying the toolbox calls.
> 
> <http://oreilly.com/pub/a/mac/2004/11/02/quartz.html>
> 
> 
> Brian S.
> 
> 
> 
> 
> --
> To unsubscribe, send ANY message to: futurebasic-unsubscribe@...