Benches Apps and software

6

[OSX, C] how to create a PICT file?

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

I'm looking at the Quartz / Core Graphics libraries and I need to create a PICT. I have a CGImageRef of the image. I can create a TIFF, for example by creating a CGImageDestinationRef of type kUTTypeTIFF and passing it a dictionary with kCGImagePropertyTIFFDictionary.

I would think that the same would be true for PICT, but although there is a kUTTypePICT constant, there is no kCGImagePropertyPICTDictionary. Is there some other way I need to create picts? like there is another way I need to create PDF files?

thanks

6 replies

Sign in or join Beachball Help to reply.

  1. 0

    alexcurylo

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    A PICT is a sequence of QuickDraw drawing commands. Quartz is a fundamental replacement for QuickDraw. What you ask for is not and never will be supported.

    Probably your best bet is to use QuickTime's GraphicExporter routines in ImageCompression.h, you should be able to shimmy around a Quartz bitmap to be usable as a QuickTime GWorld source without undue difficulty.

    If you can't link to QuickTime for some reason, then you're down to creating one yourself. Here you go, good luck with that.

    http://developer.apple.com/technotes/qd/qd_14.html

    If you're just trying to put bitmapped data in, then you only need to sort out how to get one BitsRect opcode set up properly.

  2. 0

    Brian Postow

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Ok so the important thing isn't that it be a Pict file. The important thing is that I be able to put it into a pasteboard and then paste it into Word or PhotoShop.

    Is PDF the right format for that now?

    and if so, how do I get a PDF in memory so I can stick it into the pasteboard?

  3. 0

    Brian Postow

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    EDIT: Ok, it seems that I can put PDF to the clipboard. However, something wierd:

    1) I can paste to TextEdit

    2) I CAN'T paste to Word

    3) Finder says that the clipboard is empty.

  4. 0

    alexcurylo

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Heh, you've put your finger on the problem nicely 🙂

    Last time this issue came up on the lists, cocoa-dev I think it was, people tried to convince the person with the problem that PICT was obsolete so get over it, and it turned out that the sticking point was indeed that Word (I think it was Word, definitely some major Microsoft product) did not recognize any clipboard format except PICT.

    I assumed you'd already got that far so I went straight to the generally agreed solution, which was to render your graphics to a Quartz bitmap then use QuickTime to wrap it in a GWorld and make a PICT from that.

  5. 0

    Brian Postow

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    AH, except that a GWorld can't handle 600 DPI images because they end up being too large! (this is why I'm going through the process of converting a 15 year old project from QD to Quartz in the first place!)

    Interesting conundrum.

  6. 0

    alexcurylo

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Looks like if you can require Office 2008, then PDF is actually an option now.

    http://sprinkleofcocoa.blogspot.com/2008/01/microsoft-office-supports-pdf-on.htm l

    Other'n that I think you're pretty much out of luck, yep.