NSImage questions from a newbie
NSImage questions from a newbie
- Subject: NSImage questions from a newbie
- From: eblueBeta <email@hidden>
- Date: Fri, 3 Aug 2001 12:02:50 -0400
could someone help me figure out how to change an instance of NSImage
into a pict file?
theres simply no documentation.
Im not sure if Cocoa can manage this (my preferred approach),
or whether its easy or not to do with the quicktime api (which has zero
documentation on how to translate images, and the existing documentation
has the added overhead of being hard to learn),
or finally whether the aged picture utilities are even useful at this
point (can anyone say arcane?).
I am a cocoa programmer with very limited Carbon experience.
it took me 5 minutes to write the code for generating a tiff image
(standing on the shoulders of giants),
but its taken a week to realize that Pict Files are very hard to
generate.
what i have tried so far:
I told an NSImage to add a pict rep which was initialized with nil as
its data, then i tried to remove the other reps (crash)
I added the PictImageRep and tried to select the pict imagerep for
drawing (which is impossible).
I tried to initialize a PictImage Rep, then draw into it from the
TiffImageep (again not possible, leading to a crash).
I have ripped out someone else's Carbon code that creates a picHandle to
a valid Pict in memory , I then get a new instance of an NSData Object
with dataWithBuffer: sending the handle and its length (as found by
GetHandleSize), next i try to initialize a NSPICTImageRep using that
NSdata Object, again the app crashes.
I am wondering if there is a way to make use of NSbitmappedImage, but I
am quite fed up with shooting in the dark.
can anybody lay out the path one would take to turn an instance of
NSImage, into a pict file? keep in mind that I would rather steer clear
of carbon at this point unless its Quicktime.
i would ask what the steps might be to translate any NSImageRep Type
into another NSImagerep type, but from my experience no two image Reps
are supported to the same degree.