Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hpcvlx!billf From: billf@hpcvlx.cv.hp.com (Bill F. Faus) Newsgroups: comp.sys.mac.programmer Subject: Need help with bitmaps Message-ID: <101780003@hpcvlx.cv.hp.com> Date: 9 Mar 90 19:42:07 GMT Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 44 I need help on understanding how bit maps are put onto the screen. Can someone give me a mimimal program that illustrates how a bit map (say a simple rectangle 2 bytes wide and 100 bytes tall) is put onto screen. I've read the QuickDraw chapter of "Inside MacIntosh", but canot find a complete example that shows how to open a port, build a bit map, and then display the bitmap onto the screen. Which command actually writes to the screen? Is it SetPortBits, or is it CopyBits? Can bitmaps be displayed without the use of windows? So far I've been fooling with the following Think C program, which refuses to put anything on the screen: main() { BitMap myBlob; GrafPort myPort; char Blob[200]; InitGraf(&thePort); OpenPort(&myPort); SetPort(&myPort); myBlob.baseAddr = Blob; myBlob.rowBytes = 2; SetRect(&myBlob.bounds, 100, 100, 200, 102); for (i = 0; i < 200; i++) Blob[i] = 0x0F; CopyBits(&myBlob, &myPort.portBits, &myBlob.bounds, &myPort.portRect, srcCopy, 0L); } Any help would be appreciated. Or pointers to reference material. ------------------------------- Bill Faus HP Calculator Learning Products billf@cv.hp.com