Path: utzoo!attcan!uunet!aplcen!haven!decuac!decwrl!elroy.jpl.nasa.gov!ames!dftsrv!amarna.gsfc.nasa.gov!seiler From: seiler@amarna.gsfc.nasa.gov (Ed Seiler) Newsgroups: comp.sys.mac.programmer Subject: Still need help creating a QuickDraw picture Message-ID: <2223@dftsrv.gsfc.nasa.gov> Date: 2 Jun 90 08:50:17 GMT Sender: news@dftsrv.gsfc.nasa.gov Reply-To: seiler@amarna.gsfc.nasa.gov Organization: NASA Goddard Space Flight Center - Greenbelt, MD, USA Lines: 44 News-Software: VAX/VMS VNEWS 1.3-4 I still don't get it. Let me give a bit more detail. I have an image file, 512 lines by 512 pixels per line. I create a pixMap and read the image data, storing at the location starting at the baseAddr of the pixMap. The high bit of the rowBytes field is set. I create a color window via NewCWindow (windPtr is the pointer to it), and also open a color GrafPort via OpenCPort (myCGrafPtr is the pointer to it). The baseAddr, rowBytes, and bounds of the portPixMap of the cGrafPort are assigned the corresponding values of the pixMap. When I do CopyBits((BitMap *) *(*myCGrafPtr).portPixMap, &(windPtr->portBits), &(*pixMapHndl)->bounds,(windPtr->portRect), srcCopy, NULL); the image appears in the window. So far so good. Now I would like to creat a QuickDraw picture. If I do SetPort(windPtr); picHndl = OpenPicture(&(windPtr->portRect)); CopyBits(&(windPtr->portBits), &(windPtr->portBits), &(windPtr->portRect), &(windPtr->portRect), srcCopy, NULL); ClosePicture(); no copybits opcode shows up, but the sequence: version op, version, header op, size, fBBox, <4 bytes reserved>, DefHilite, Clip, opEndPic occurs. If I try SetPort(myCGrafPtr); picHndl = OpenPicture(&(windPtr->portRect)); CopyBits((BitMap *) *(*myCGrafPtr).portPixMap, (BitMap *) *(*myCGrafPtr).portPixMap, &(myCGrafPtr->portRect), &(myCGrafPtr->portRect), srcCopy, NULL); ClosePicture(); then after the version opcode of 0011, the 4 following bytes are 0000, DD50, rather than 02FF, 0C00. After that it looks like a picture, with a copybits opcode. This doesn't seem to qualify as a picture, and a call to DrawPicture doesn't draw anything. Just what is the correct way to create the picture? Edward Seiler seiler@dftnic.gsfc.nasa.gov Mail Code 635 seiler@chrpserv.gsfc.nasa.gov Goddard Space Flight Center (301) 286-9421 Greenbelt, MD 20771 "Against stupidity, the gods themselves contend in vain"