Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!stevec From: stevec@Apple.COM (Steve Christensen) Newsgroups: comp.sys.mac.programmer Subject: Re: Correct way to set pixels? Message-ID: <52568@apple.Apple.COM> Date: 7 May 91 23:52:22 GMT References: <1991May7.041053.28488@nntp-server.caltech.edu> <1243@dms.UUCP> Distribution: na Organization: Apple Computer Inc., Cupertino, CA Lines: 26 In article <1243@dms.UUCP> rotberg@dms.UUCP (Ed Rotberg) writes: >that rasnow@bek-mc.caltech.edu (Brian Rasnow) wrote: >> The Think C profiler tells me Line(1,0) and Line(0,1) are nearly twice as >> slow as Line(1,1). Anyone know why? It seems there should be a faster >> (legal) way to set a pixel. > > >How about PutPixel() (or is it PutRGBPixel()?). This is defined in IM V. >I'm not sure just how fast it is, but it probably deon't need to go through >any algorithmic loops at all. Well, as was pointed out to me, you could call SetCPixel() if your code will only run on a color Mac. Since this call doesn't exist on the older black and white Macs, I suggested doing a MoveTo/LineTo to draw the pixel, since that will work on all Macs. There's no single QuickDraw call on both b&w and color Macs that does the job. If the bits you want to blast to the screen are in the right order, you could just use CopyBits to blit it onto the screen... steve -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Steve Christensen Never hit a man with glasses. stevec@apple.com Hit him with a baseball bat.