Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!agate!helios.ee.lbl.gov!ux1.lbl.gov!osborn From: osborn@ux1.lbl.gov (James R Osborn) Newsgroups: comp.sys.mac.programmer Subject: Drawing Points Fast ?? Keywords: Points Message-ID: <2068@helios.ee.lbl.gov> Date: 10 Mar 89 08:29:16 GMT Sender: usenet@helios.ee.lbl.gov Reply-To: osborn@ux1.lbl.gov (James R Osborn) Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 35 Hi there, A short while ago there was an ongoing discussion about drawing a bunch of points into a window fast. Some people suggested drawing into the bitmap directly or into an offscreen one directly and then copybitsing into place. I was wondering... Would BitSet(bytePtr, numBit) and BitClr(bytePtr, numBit) be faster than using MoveTo(h, v) with Line(0, 0)? I guess you would have to calculate numBit, but it is fairly easy (but fast?) to do. If your Point is in global coordinates, then numBit = Point.v * rowBytes * 8 + Point.h and bytePtr = baseAddr (of the screen) So would this be faster than MoveTo(h, v) with Line(0, 0)? I know I know, you would have to make sure you did not draw outside of your window (unless you're trying to draw into the whole screen). And you would get some funky results if the cursor is visible. You could call hide and show I suppose. Any other problems? Would BitSet and BitClr be faster than manipulating the memory yourself? (i.e. - how optimized are these routines anyway :-) James R. Osborn Lawrence Berkeley Laboratory osborn@ux1.lbl.gov