[futurebasic] Re: [FB] [X-FB sort of] Last Mac/OS that will write Quickdraw PICT vector graphics

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

From: Deep <Info@...>
Date: Fri, 15 Jan 2010 13:19:53 +0000
Clipboard also needs tweaking due to the way the clipboard has changed in
10.5, but older functionality still exists. Again, there is a demo in the
FB5 Examples. There is no reason why PICT as a type of data will not work on
the clipboard, because it only knows the type (PICT) and the quantity of
data (the PictHandle). However, the number of apps where you can then paste
that data will gradually disappear, some will call it "Unrecognised Data".
In 10.5/10.6, when you have a PICT on the clipboard, switch to the Finder
and use Show Clipboard from the Edit menu. You will get a black screen with
the label "Unrecognised data" or something similar. You can still paste it
into Intaglio, but this should be the hint that it is on its way out...!

Moving from FBII to FB4 may have taken time, but moving from FB4 to
FB5/FBtoC is a lot easier as most of it is still the same. You will need to
make a few minor tweaks to your source (like I did with RC's older demo).

From my own experience, I would advise you to think as follows:

1) Do not think in terms of "I use PICTs and QuickDraw, how do I support
that in FB5/FBtoC?"

2) Ask yourself "What does my program achieve?"

3) Answer: "It produces vector PICT images, so would another more modern
format be better"? In this case, PDF would be better.

4) How do I use the MacOS to do all the hard work? Use CoreGraphics, short
apps exist in the Examples folder which makes graphics and saves to PDF.

From your description of your app, creating some vector images and
compositing them together, this seems like an ideal job for CoreGraphics.

The way CoreGraphics operate, you open a CGContext (similar to an old
QuickDraw GWorld) where you then draw your graphics using lines, circles,
fills, etc. Then, you tell it what to do with that CGContext, such as
display on screen, send to a printer, save as a file such as
PDF/TIFF/JPG/etc, completed in a few lines of code. Unlike QuickDraw, there
is automatic antialiasing, transparency support, and so much flexibility.
Look at the examples in the FB5 folder for some inspiration on its
possibilities. If you look at the Intaglio special effects, many are done
using CoreGraphics and completed in a few lines of source code, and if you
have seen Apple Keynote (iWork) style presentations, again a lot is
dependent on CoreGraphics.

OpenGL is where the MacOS talks to the video card and harnesses the
graphical processing power of the video hardware to perform special
computations, but often used for things like transparency, or 3D rendering
or special effects like you see in iChat or some Widgets which is
computationally intensive. CoreGraphics is the MacOS graphical engine, and
it invisibly harnesses the power of the video card (sometimes via OpenGL)
but does it invisibly in the background for you, you just tell CoreGraphics
to place a circle and a half transparent square on top, it uses the hardware
and software available to do it as quickly as possible.

> From: PZ <pierrezippi@...>
> Reply-To: <futurebasic@...>
> Date: Fri, 15 Jan 2010 06:44:35 -0600
> To: <futurebasic@...>
> Subject: Re: [FB] [X-FB sort of] Last Mac/OS that will write Quickdraw PICT
> vector graphics
> OK - Deep and Roberts demo proves to me that PICT is not yet broken. The
> demo indeed does create a vector pict file that is editable in Intaglio. I
> will try to implement the RECORD for pict params. My code only DIMs the
> pictHandle. 
> What about the clipboard? Will it also function once the pict params are
> defined?
> Yes, I know that I need to move away from PICT. What is the difference
> between CoreGraphics and OpenGL? Are there any FB4 examples? OK, OK! I know
> I need to move to FBtoC as well - but one step at a time. I just finished
> moving all my apps from FBII to FB4 - and the PICT problem shows I'm not yet
> finished with that task.
> Thanks for the help and direction. I hope the PICT problem resolves as
> easily as the example looks.
>> From: Deep <Info@...>
>> Reply-To: <futurebasic@...>
>> Date: Fri, 15 Jan 2010 09:55:27 +0000
>> To: <futurebasic@...>
>> Conversation: [FB] [X-FB sort of] Last Mac/OS that will write Quickdraw PICT
>> vector graphics
>> Subject: Re: [FB] [X-FB sort of] Last Mac/OS that will write Quickdraw PICT
>> vector graphics
>> Pierre,
>> Five years ago, Robert Covington posted a demo to the list. Have tweaked it
>> slightly for FB5/FBtoC compatibility and shown it below. It happily
>> generates vector PICT on MacOS X 10.6.2 MacBook Pro (Intel) so it would
>> appear that vector PICT has not broken inside QuickDraw yet, but bear in
>> mind that it relies on techniques which are not encouraged.
>> You really should reconsider if PICT is the best option for your app for the
>> long term? Strongly recommend that you move to CoreGraphics which does a lot
>> of the hard work for you and is for 10.4 onwards. However, it does not
>> support vector PICT, so when telling CoreGraphics to save an image to PICT
>> it will save it only as a bitmap. CoreGraphics will happily output vector
>> formats such as PDF. Vector PICT and vector PDF will both import into
>> Intaglio as editable vector formats so if you are planning to use the vector
>> file with Intalgio, it should make little difference. There are examples in
>> the FB5 Examples folder.
>> Hope it helps,
>> Deep
>> 'Demo follow:
>> BEGIN RECORD MyOpenCPicParams
>> DIM srcRect as Rect
>> DIM hRes as Fixed
>> DIM vRes as Fixed
>> DIM version as short
>> DIM reserved1 as short
>> DIM reserved2 as long
>> DIM myPic as MyOpenCPicParams
>> dim ThePictHandle as handle
>> end globals
>> DIM buff.512
>> LOCAL FN SaveThatPictFile(MypictHandle as handle)
>> DIM @myfilename$
>> DIM bytes&
>> DIM @outSpec as FSSpec
>> LONG IF MypictHandle
>> myfilename$ = FILES$(_FSSpecSave,"Save PICT asŠ","Untitled",outSpec)
>> LONG IF myfilename$ <> ""
>> OPEN "O",1,@outSpec
>> WRITE FILE #1, @buff,512
>> bytes& = FN GETHANDLESIZE(MypictHandle)
>> WRITE FILE #1, [MypictHandle], bytes&
>> CLOSE #1
>> Local FN GetPictHandle as handle
>> dim DrawRect as RECT
>> DIM @PictH as handle
>> PictH = 0
>> SETRECT(DrawRect,0,0,200,200)
>> myPic.srcRect;8 = @DrawRect
>> myPic.hRes = FN LONG2FIX(72)
>> myPic.vRes = FN LONG2FIX(72)
>> myPic.version=-2
>> PictH = FN OpenCPicture(@myPic)
>> SETRECT(DrawRect,25,25,175,175)
>> FRAMERECT(DrawRect)
>> SETRECT(DrawRect,50,50,150,150)
>> PAINTRECT(DrawRect)
>> MOVETO(15,15)
>> DRAWSTRING("Demo Drawing")
>> ClosePicture
>> Long if PictH
>> HLock(PictH)
>> End If
>> End FN = PictH
>> ThePictHandle = FN GetPictHandle
>> FN SaveThatPictFile(ThePictHandle)
>>> From: PZ <pierrezippi@...>
>>> Reply-To: <futurebasic@...>
>>> Date: Thu, 14 Jan 2010 19:58:51 -0600
>>> To: <futurebasic@...>
>>> Subject: [FB] [X-FB sort of] Last Mac/OS that will write Quickdraw PICT
>>> vector
>>> graphics
>>> This is the most important question I have ever asked this list.
>>> What is the last Mac processor and OS that will write QuickDraw PICT vector
>>> graphics?
>>> My world revolves around several FB apps I wrote (with the help of the FB
>>> list) that create specialized charts as vector pict. I then need to
>>> edit/montage multiple charts into a final composite chart using a pict
>>> vector editor such as Intaglio (previously MacDraw, Canvas, ClarisDraw,
>>> etc).
>>> It seems as if the ability of my FB apps to write vector QuickDraw fails at
>>> some point. What is the latest processor/OS combo that will allow me to
>>> create vector QuickDraw clipboard or docs?
>>> I can write QuickDraw vector picts with:
>>> iMac G5 with OS 10.4.8
>>> iMac 2 GHz Intel Core 2 Duo with OS 10.5.8
>>> I cannot write vector picts with:
>>> iMac 3 GHz Intel Core 2 Duo with OS 10.5.6
>>> iMac 3 GHz Intel Core 2 Duo with OS 10.6.2
>>> - Pierre
>>> --
>>> To unsubscribe, send ANY message to: futurebasic-unsubscribe@...
>> --
>> To unsubscribe, send ANY message to: futurebasic-unsubscribe@...
> --
> To unsubscribe, send ANY message to: futurebasic-unsubscribe@...