[comp.sys.mac.programmer] 32 bit qdraw problem

is_s440@kingston.ac.uk (Lucas S) (01/31/91)

Problem:

I am trying to open a 32 bit PICT (v1) file and then copy a part of it
into a new file. Machine : IIcx with 32bit qdraw init installed.

the way i am trying to do this is:

1. open new color window 
2. read in PICT and display.
3. Create new Color Port, based on the current port. create the pixmap
as in the scott knaster book.
4. copy bits from the color window to the new port.
5. write file to disk.

when i open the file it is indexed not rgb and is only 7 bit (i check
this with photoshop).

what seems to be going wrong is that the scott knaster technique gets
the pixel depth from the qdevice which in my case is only an 8 bit monitor.

I need to keep the 32 bit info so it can used in an application running
on a machine with a 32bit qd and a proper monitor capable of displaying
the file.

so..
Can I create a pixmap/color port which can keep all the color info i need?
Obviously, I could make a 32bit deep pixmap and stick it in the current port but
then what about the color table info? I need to preserve the color tabel info
which belongs to the original image dont I ?

The other thing is that NewCWindow does NOT create a color port - ive tried
it. The port will be the old type with a bitmap not a pixmap.
The only way I seem to be able to create a real color window is to
create a CwindowPtr and cast the result of the NewCWindow function to it. is
this right ?

Confused...
simon lucas
kingston polytechnic
is_s440@ux.kingston.ac.uk