🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #14606

fast plotting and screen saving

#14606
From: sdh
Date: Tue, 27 Jan 1987 18:54
27 lines
1743 bytes
To answer the question on how to plot a single poinr
faster than  MoveTo(x,y) LineTo(x,y) with a pensize of 1,1:

consider what you want.  You want to set a single but on the
screen.  No sweat.  Here's a way to do it:

Create a bitmap that has 1 pixel in it.  It would need a 2 byte
bitmap, and a rectangle that's 1x1.  Use CopyBits to put it where you
want it to go.  You want the source rectangle to be the bitmap bounds,
the destination to be the x,y,x+1,y+1, the destination bitmap is the
thePort->portbits, and the clip region will probably be nil.

There is a more direct way.  You calculate the begining address of screen
memory and find the byte that you want to write into, and what bit needs to
be turned on.  This will probably be the optimal method, but you don't get
all the wonderful clipping.

If you want to save the bit image on the screen because you are putting
a window over (from a dialog box or some such), you should know what the
coordinates of the window to be drawn are, and you use CopyBits to copy
the image that will be covered up by that rectangle to an off screen
bitmap.  To refresh, do the reverse.

Steve "I've been away from Mac programming so this sounds sketchy" Hawley

(ucbvax, decvax)!bellcore!sdh
Technical Details
Message-ID: <354@thumper.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!princeton!allegra!ulysses!faline!thumper!sdh

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!princeton!allegra!ulysses!faline!thumper!sdh
From: sdh@thumper.UUCP
Newsgroups: comp.sys.mac
Subject: fast plotting and screen saving
Message-ID: <354@thumper.UUCP>
Date: Tue, 27-Jan-87 13:54:02 EST
Article-I.D.: thumper.354
Posted: Tue Jan 27 13:54:02 1987
Date-Received: Thu, 29-Jan-87 03:24:28 EST
Organization: Bell Communications Research Inc., Morristown, NJ
Lines: 27