Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: Correct way to set pixels? Message-ID: <52440@apple.Apple.COM> Date: 4 May 91 02:45:12 GMT References: <5865@ns-mx.uiowa.edu> <52427@apple.Apple.COM> <52431@apple.Apple.COM> Distribution: na Organization: Apple Computer Inc., Cupertino, CA Lines: 33 In article <52431@apple.Apple.COM> nerm@Apple.COM (Dean Yu) writes: >In article <52427@apple.Apple.COM> stevec@Apple.COM (Steve Christensen) writes: >>wolf@piquet.cipl.uiowa.edu (Michael J. Wolf) writes: >>>What is the proper and endorsed manner to set and clear pixels in a window? >>> >>>I would like to be able to do somethig like a fatbits editor. >> >>Well, certainly one way of doing it is something like this: >> >> ForeColor(pixelOn ? BlackColor : WhiteColor); >> MoveTo(h,v); >> Line(1,0); >> >>This will draw a 1-pixel-long line. There's no QuickDraw routine to touch a >>single pixel... >> > > Actually, Line(0,0) will draw a single pixel... > SetCPixel() will touch a single pixel if you are running under Color QuickDraw and dealing with a color port. If that's not the case, then you can fill in a pixel with a single QuickDraw call: r.top = v; r.left = h; r.bottom = v+1; r.right = h+1; PaintRect(&r); -- ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "But where the senses fail us, reason must step in." - Galileo