campbellb@gtephx.UUCP (Brian Campbell) (06/30/89)
Using the IIGS toolbox, how can one plot a single point (i.e. pixel) on the SHR screen in a way that's analogous to the BASIC PLOT statement for lo-res, and HPLOT for hi-res? If there is a toolbox routine for this, I can't find it. I have successfully plotted points by using the MOVETO and LINETO calls, by drawing a one pixel line. And I have also generated a 1 pixel size rectangle using MAKERECT (not sure of the name off hand) and plotted it with PAINTRECT. This latter technique worked quite well in an application where I wanted to have the user define the size of a "variable size pixel". Anyway for single pixels, is there a better way?
dlyons@Apple.COM (David Lyons) (07/01/89)
In article <441fa838.f759@gtephx.UUCP> campbellb@gtephx.UUCP (Brian Campbell) writes: >Using the IIGS toolbox, how can one plot a single point (i.e. pixel) on the >SHR screen in a way that's analogous to the BASIC PLOT statement for lo-res, >and HPLOT for hi-res? If there is a toolbox routine for this, I can't find it. >I have successfully plotted points by using the MOVETO and LINETO calls, by >drawing a one pixel line. And I have also generated a 1 pixel size >rectangle using MAKERECT (not sure of the name off hand) and plotted it >with PAINTRECT. This latter technique worked quite well in an application >where I wanted to have the user define the size of a "variable size pixel". >Anyway for single pixels, is there a better way? There's an easy way regardless of the size you want: make the QuickDraw II Pen larger with SetPenSize(horizontalSize,verticalSize). Then draw with MoveTo and Line(0,0) (or LineTo to the same place you already moved to), and you'll get a rectangle of your pen size, not necessarily just a single pixel. BTW, I think you're referring to SetRect, which takes a rectangle pointer and four coordinates (x,y)(x,y) and stores them into the rectangle in (y,x)(y,x) format. --Dave Lyons, Apple Computer, Inc. | DAL Systems AppleLink--Apple Edition: DAVE.LYONS | P.O. Box 875 AppleLink--Personal Edition: Dave Lyons | Cupertino, CA 95015-0875 GEnie: D.LYONS2 or DAVE.LYONS CompuServe: 72177,3233 Internet/BITNET: dlyons@apple.com UUCP: ...!ames!apple!dlyons My opinions are my own, not Apple's.