Paint Simulator
Volume Number: | | 1
|
Issue Number: | | 13
|
Column Tag: | | Special Projects
|
A Mac Paint Simulator in Basic ![](img001.gif)
By Mike Steiner, Sierra Vista, AZ, MacTutor Contributing Editor
MacPaint Functions in Basic!
The program, written in Microsoft BASIC, accompanying this column simulates some of the features of Macpaint. Why, you are probably asking yourself, would anyone want to simulate Macpaint in a BASIC program when every Macintosh comes with Macpaint at no extra cost? The reason is that transferring a Macpaint picture to a BASIC program is not the easiest thing in the world to do. Having your own Basic version of MacPaint can be very helpful. [The real reason is the challenge! And Mike has succeeded admirably. -Ed]
Here are some of the problems of trying to mix picts with Basic: After making the picture, you have to copy it to the clipboard (which limits you to the size of the Macpaint window, thus eliminating the ability to make a full-screen picture) before entering BASIC. Once in BASIC, you then have to transfer the picture from the clipboard to the screen. If you want to use the picture again, you have to save it as a disk file. The program with this article will let you draw a picture, save it to and load it from a disk. The routine that loads pictures from disk can be incorporated into your own programs to let you convientiently use pictures in them.
Program Notes
The program is fairly straight forward and does not use any programming tricks; everything used is documented in the Microsoft BASIC manual. However, it requires a 512K Macintosh . A 128K Mac does not have enough memory to handle the necessary arrays and heap requirements.
Instructions are incorporated into the program and are accessable via the Instructions option in the Options menu. There is one area where operation of the program differs from the standard and bears mentioning here. When you save a picture to disk, you are not limited to saving the entire picture. You must select the section of the picture (to include the whole picture if you want) as the first step in the save process.
![](img002.gif)
Fig. 1 Screen of Mac Paint Simulator
How it Works
The program starts by CLEARing memory from the data segment to increase the application heap memory. The heap is where BUTTON, EDIT FIELD, and PICTURE information are stored. Without the increase of heap memory the program results in a system error 25 (out of heap space) whenever it tries to print a picture.
The program then performs a GOSUB to init, which is the initialization routine. This routine causes all variables to default to integers unless they are declared otherwise. (The only other variable format used is string variables.) The program then DIMensions the arrays it will use and generates the drawing window and the program menus. It then dispays the names of the program and programmer and the version and date. (This display is also available by selecting About... from the File menu.) It then initializes variables and the cursor arrays and RETURNs to the main program.
The routine called start is the main routine of the program. All subroutines eventually return to start. While in the start loop, the program enables drawing and checks for a menu selection. The loop sends the program to the subroutine cursorposition. This subroutine monitors the position of the cursor on the screen and changes the cursor to an arrow when it is outside the drawing window and changes it to a cross when inside the window. Note the statement dummy = MOUSE (0) preceding the GOSUB. References to MOUSE (1) through MOUSE (6) return values related to the most recent click of the mouse button. MOUSE (0) checks for a mouse click, so even though it is not needed by the cursorposition routine, it must have been referenced for the routine to work. The ON shape GOSUB line sends the program to the appropriate drawing routine, depending on what shape has been selected to be drawn.
Drawing Shapes
The routines box, roundbox, and oval are essentially the same routine, differing only in the Quickdraw routines they use. They first check to see if the mouse button has been pressed. If it has not, the routines RETURN to start. If the button has been pressed, the routine enters a loop that first goes to a subroutine called getpoints. Getpoints determines the coordinates of diagonally opposite corners of a rectangle. It assigns the top left corner as the start and the bottom right corner as the end, putting the coordinates in the variable array rect. Control is then returned to the shape-drawing routine where the shape is drawn twice and getpoints is entered again. Because the penmode was set to 10 (XOR) before the routine was entered, the pen reverses the color of the screen it passes over; by drawing the shape twice, the shape continually draws and erases itself. When the mouse button is released, control is returned to the drawing program where the pen mode is set to 8 (copy) and the shape drawn once again to leave it on the screen. The routine then RETURNs to start.
The straightline routine is similar to the framed shape routines except that starting and ending points are not swapped to insure that start is to the upper-left of finish, and a straight line is drawn. The subroutine called free is the simplest of all. It continually draws a line to the current cursor position from the previous cursor position after moving initially to the point where the mouse button was pressed.
Text first sets the text mode to 1 (OR). A bug in the quickdraw routine that draws text puts blank spaces after the text that is printed. These spaces will erase any black pixels that are close to the end of the text. Setting the text mode to OR eliminates this problem. The routine then sets the selected text size. The first time the routine is entered after it is selected, when the mouse button is pressed, the left margin is set at the cursor's horizontal position. Text is entered normally, and when the Return key is pressed, text continues on the next line at the left margin. You may change fonts, size, and styles of the text while entering it without losing your character's position on the screen. A carriage return uses the current left margin as the left margin. To change margins, move the cursor to where you want the margin to be and click the mouse button.
Selecting Menu Items
When a menu item is selected while the program is in the start routine's loop, the number of menu selected is stored in the variable menu0, which determines the subroutine to be entered. These subroutines are described below in increasing order of complexity.
Menu4 (Shape) checks the menu item selected and unchecks the previously selected item. It stores the number of the selected item in the variable shape. Menu5 (Pensize) operates identically to Menu4, using the variable size to store the pen size selected. Menu6 (Font) is similar to Menu4, but has to take into consideration that the fonts begin with zero rather than 1. Also, the program does not check to see which fonts are in the System. If a font not in the system is chosen, the default font (currently Geneva) is automatically used even though the menu indicates a different font was chosen.
Menu7 (Style), again, is similar to Menu4, but is a multi-check menu (i.e., more than one item may be checked at the same time), so the routine determines whether item selected is checked or not and toggles the check mark on or off. Also, checking menu item 1 (Plain) turns off all the other checkmarks. To further complicate this routine, TEXTFACE uses a geometrical progression to determine the style in order for the various styles to be combined. As a menu item is checked or unchecked, the variable face has to have the appropriate value added or subtracted.
Menus 1 (File), 2 (Edit), and 3(Options) enter subroutines rather than assign values to variables as do 4 through 7. Menu3 gives the choice of selecting the size of the text, using the eraser, clearing the screen, or viewing the instructions. In increasing order of complexity, these routines are as follows:
Clearscreen does a CLS and returns to start. Instructions clears the screen and displays three pages of instructions, waiting for the OK button to be pressed after each page is read.
Erase works the same way as does free, except that it uses an eraser-shaped cursor (the same one that Macpaint uses) and that the pen mode is set to 11 (BIC) which changes all black pixels to white, thereby erasing all that it passes over.
Textsize overlays a second window on the drawing window, first storing the screen area that is obliterated by the window (the way this is done is explained in the portion of this article covering Cut, Copy, and Paste). The window displays an edit field and an OK button along with instructions to type the size of the text. A WHILE -- WEND loop waits for the OK button to be clicked or the Return key to be pressed. It also monitors the cursor position, changing it to an I-beam when it is in the edit field. Because the Macintosh cannot handle text sizes smaller than four points or larger than 127 points, the routine wrongsize is used to inform the user that he has selected a size that is out of range if he should do so. After a valid size has been selected, the window is closed and the portion of window 1 that was erased by window 2 is restored.
Menu2 handles Cut, Copy, and Paste. Cut and Copy use the routine called getit. Getit goes to a subroutine called corners. This routine determines the corners of a selection rectangle the same way that the shape drawing routines use and then RETURNs to getit. Getit then GOSUBs to dimbox. Dimbox DIMensions the array box, using the formula given in the BASIC manual, and does a screen GET for the area selected. It then RETURNs to getit. Getit then determines whether it was called by Copy or Cut and, if the latter, erases the selected area of the screen. Dimbox is the routine that also saves the screen area behind dialog windows displayed in textsize, Open, Save, Print, and About
Paste uses the routine putit. This routine first GOSUBS to corners. Then if corners returns a selection rectangle, it PUTs the information stored in box into the rectangle, scaling it to fit. If no rectangle was selected, it PUTs the information on the screen, unscaled, where the cursor is when corners is exited. This position is the top left corner of the pasted picture. A modified form of putit is used to restore screen information when a dialog window is closed. Note that Basic itself does not even do this when system windows overlap!
Menu1 offers the options to start a new picture, Open a picture stored to disk, Save a picture to disk, Print a picture, and get information about the program. About opens a second window, storing the information behind it as described above, loads a picture called About into the window, and waits for the OK button to be clicked. It then closes the window and restores the background. New is an alternate entry point for the clearscreen subroutine.
Open presents a dialog box that displays only those files generated by this program. The files are sequential text files of Type MIKE. After the file is selected, the window is closed and the background restored. The selected file is read into the variable image$ and the PICTURE statement puts the picture on the screen in the same place and size as it was when it was saved.
Save first waits for the user to select the portion to be saved, using getit as described above. PICTURE ON then causes any screen action to be placed in a buffer in memory. A screen PUT then places the data selected into the buffer and PICTURE OFF ends the record mode. The routine then displays a dialog box requesting the name of the file to which the picture will be saved. After Save is clicked, the window is closed, the background data restored, and the picture printed to disk. The file is then closed and the Type changed to MIKE.
Printit works very much as does Save, with the following exceptions: It prints the entire screen rather than a selected portion, and it sends the picture to the Imagewriter rather than to a disk file. By use of LPT1:Prompt rather than the more often used LPT: the program allows for selection of tall or tide orientation of the paper, normal or high quality printing, and (if you have the new Imagewriter driver file), 50 percent reduction.
More elements may be added to the program if you want to do so. A few of these are irregular shaped pens (such as | or --), filled areas, patterns for areas and lines, and polygons. I leave this as an exercise for you should you be so inclined.
![](img003.gif)
Sidebar
The Macpaint Simulator requires that the picture file About be on the same disk as the program. If the program were being copied from one machine to antother or being transmitted over a modem, this would be no problem. But, how do you get it to another person via the printed media, such as Mactutor ? This problem proved to be almost as interesting as writing the program itself. The answer became obvious when I realized that the picture file is a sequential text file. I wrote a program (Read Picture) that read the file in one byte at a time, translated the bytes to their ASCII code, and wrote the ASCII as DATA statements to a file called Datafile. Once I had the DATA statements on file, I wrote a short program that translates them back into characters and writes them to a disk file called About I then renamed the program Make Picture. Both listings are provided here. You need to type in and run Write Picture before running Paint Simulator. Read Picture is provided so that if you need to send a picture file to someone by this means you will have the tools to do so. The programs are provided in their basic forms, designed only to translate About If you plan to use them often, you will probably want to modify them to prompt you for the names of the respective files.
CLEAR,250000!
GOSUB init
start:
IF shape <> 7 THEN textflag = 0
menu0 = MENU (0)
MENU
WHILE menu0 = 0
menu0= MENU (0)
dummy = MOUSE (0):GOSUB cursorposition
PENMODE 10
PENSIZE size,size
ON shape GOSUB free,box,roundbox,oval, straightline,dummy,text
WEND
ON menu0 GOSUB menu1,menu2,menu3, menu4,menu5,menu6,menu7
free:
MOVETO MOUSE (1), MOUSE(2)
PENMODE 8
WHILE MOUSE(0) <0 : LINETO MOUSE (1), MOUSE (2): WEND
RETURN
box:
IF MOUSE(0) > -1 THEN RETURN start
WHILE MOUSE (0) < 0
GOSUB getpoints
FRAMERECT VARPTR(rect(0))
FRAMERECT VARPTR(rect(0))
WEND
PENMODE 8
FRAMERECT VARPTR (rect(0))
RETURN
roundbox:
IF MOUSE(0) > -1 THEN RETURN start
WHILE MOUSE (0) < 0
GOSUB getpoints
FRAMEROUNDRECT VARPTR (rect(0)),20,20
FRAMEROUNDRECT VARPTR (rect(0)),20,20
WEND
PENMODE 8
FRAMEROUNDRECT VARPTR (rect(0)), 20,20
RETURN
oval:
IF MOUSE(0) > -1 THEN RETURN start
WHILE MOUSE (0) < 0
GOSUB getpoints
FRAMEOVAL VARPTR(rect(0))
FRAMEOVAL VARPTR(rect(0))
WEND
PENMODE 8
FRAMEOVAL VARPTR (rect(0))
RETURN
straightline:
IF MOUSE (0) > -1 THEN RETURN start
WHILE MOUSE (0) < 0
hstart = MOUSE (3): vstart = MOUSE (4)
hend = MOUSE (5): vend = MOUSE (6)
MOVETO hstart,vstart
LINETO hend,vend
MOVETO hstart,vstart
LINETO hend,vend
WEND
PENMODE 8
MOVETO hstart,vstart
LINETO hend,vend
RETURN
text:
IF MOUSE (0) < 0 THEN textflag = -1
IF textflag = 0 THEN RETURN start
IF MOUSE (0) < 0 THEN leftmargin = MOUSE (3): MOVETO leftmargin,
MOUSE(4)
TEXTMODE 1
TEXTSIZE txtsize
text$=CHR$(0)
OBSCURECURSOR
text$= INKEY$
PRINT text$;
IF text$ = CHR$(13) THEN PRINT PTAB (leftmargin);
SHOWCURSOR
RETURN
menu1:
menu1 = MENU (1)
ON menu1 GOSUB clearscreen,restorepic, savepic,printpic,dummy,about
IF menu1 = 8 THEN MENU RESET:END
RETURN start
menu2:
menu2 = MENU (1)
ON MENU2 GOSUB getit,getit,putit
RETURN start
menu3:
menu3 = MENU (1)
ON menu3 GOSUB txtsize,dummy,eraser, clearscreen,dummy,instructions
RETURN start
menu4:
oldshape = shape
shape = MENU (1)
MENU 4,oldshape,1
MENU 4,shape,2
RETURN start
menu5:
oldsize = size
size = MENU (1)
MENU 5,oldsize,1
MENU 5,size,2
RETURN start
menu6:
oldfont = font
font = MENU (1)-1
MENU 6,oldfont+1,1
MENU 6,font+1,2
TEXTFONT font
RETURN start
menu7:
check = MENU (1)
IF check <>1 THEN check(check) = NOT check(check): MENU 7,check,ABS(check
(check)) +1
IF check = 1 THEN FOR i = 2 TO 8: MENU 7,i,1: check (i) = 0: NEXT:
face = 0
IF check <> 1 AND check (check) THEN MENU 7,1,1:check (1) = 1:face
= face + 2 ^ (check-2) ELSE face = face - 2^(check-2)
IF face = 0 THEN MENU 7,1,2
TEXTFACE face
RETURN start
crosscursor:
SETCURSOR VARPTR (cross(0))
RETURN
textcursor:
SETCURSOR VARPTR (textcursor(0))
RETURN
cursorposition:
IF MOUSE (2) > 0 AND MOUSE (2) <= (bottom - top) AND MOUSE (1) >
0 AND MOUSE (1) <= (right-left) THEN IF shape = 7 THEN GOSUB textcursor
ELSE GOSUB crosscursor
IF MOUSE (2) < 0 OR MOUSE (1) < 0 THEN INITCURSOR
IF MOUSE (1) > (right-left) OR MOUSE (2) > (bottom-top) THEN INITCURSOR
RETURN
waitforpress:
WHILE MOUSE (0) = 0
GOSUB cursorposition
WEND
RETURN
erasecursor:
SETCURSOR VARPTR (eraser(0))
WHILE MOUSE (0) = 0
IF MOUSE (2) > 0 AND MOUSE (2) <= (bottom - top) AND MOUSE (1)
> 0 AND MOUSE (1) <= (right-left) THEN erasecursor
IF MOUSE (2) < 0 OR MOUSE (1) < 0 THEN INITCURSOR
IF MOUSE (1) > (right-left) OR MOUSE (2) > (bottom-top) THEN
INITCURSOR
WEND
RETURN
eraser:
GOSUB erasecursor
PENSIZE 16,16
PENMODE 11
MOVETO MOUSE (1), MOUSE (2)
WHILE MOUSE(0) <0 : LINETO MOUSE (1), MOUSE (2): WEND
RETURN
getpoints:
hstart = MOUSE (3): vstart = MOUSE (4)
hend = MOUSE (5): vend = MOUSE (6)
IF vstart > vend THEN SWAP vstart,vend
IF hstart > hend THEN SWAP hstart,hend
rect (0) = vstart:rect(2) = vend
rect (1) = hstart:rect(3) = hend
RETURN
corners:
tempshape = shape
shape = 0
PENSIZE 1,1
PENMODE 10
GOSUB waitforpress
WHILE MOUSE (0) < 0
GOSUB getpoints
FRAMERECT VARPTR(rect(0))
FRAMERECT VARPTR(rect(0))
WEND
PENMODE 8
shape = tempshape
RETURN
dimbox:
DIM box (4+ (((hend - hstart) + 1)* 2 * INT(((vend - vstart) + 16)
/ 16)))
GET (hstart,vstart)-(hend,vend),box
RETURN
getit:
ERASE box
GOSUB corners
IF (hstart = hend) OR (vstart = vend) THEN DIM box(1):RETURN
GOSUB dimbox
IF MENU2 = 2 THEN ERASERECT VARPTR (rect(0))
RETURN
putit:
GOSUB corners
IF (hstart<>hend) AND (vstart<>vend) THEN PUT (hstart,vstart) - (hend,vend),
box, PSET: ELSE PUT (hstart,vstart), box, PSET
RETURN
clearscreen: CLS : RETURN
savepic:
GOSUB getit
PICTURE ON
PUT (hstart,vstart),box,PSET
PICTURE OFF
ERASE box
hstart = 53:vstart = 35:hend = 372:vend = 154
GOSUB dimbox
savedname$ = FILES$(0,"Name of Picture to Save")
PUT (hstart,vstart),box
IF savedname$ = "" THEN RETURN
OPEN savedname$ FOR OUTPUT AS #1
PRINT #1,PICTURE$
CLOSE #1
NAME savedname$ AS savedname$,"MIKE"
RETURN
restorepic:
INITCURSOR
ERASE box
hstart = 53:vstart = 35:hend = 416:vend = 186
GOSUB dimbox
getname$ = FILES$(1,"MIKE")
PUT (hstart,vstart),box
IF getname$ = "" THEN RETURN
info:
OPEN getname$ FOR INPUT AS #1
image$ = INPUT$(LOF(1),1)
PICTURE,image$
CLOSE #1
RETURN
printpic:
INITCURSOR
ERASE box
hstart = 0: vstart = 0: hend = right - left: vend = bottom - top
GOSUB dimbox
PICTURE ON
PUT (0,0), box
PICTURE OFF
ERASE box
hstart = 9:hend = 496:vstart = 1:vend = 160
GOSUB dimbox
OPEN "lpt1:prompt" FOR OUTPUT AS #1
PUT (hstart,vstart),box
ON ERROR GOTO errorhandle
WINDOW OUTPUT #1
PICTURE
CLOSE #1
caughtit: ON ERROR GOTO 0
RETURN
errorhandle:
IF ERR = 52 THEN RESUME caughtit
txtsize:
oldtextsize = txtsize
INITCURSOR
ERASE box
hstart=100:vstart=100:hend=350:vend=200
GOSUB dimbox
WINDOW 2,"",(hstart + 11,vstart + 29) - (hend- 4,vend + 14),-2
returnhere:
CLS
TEXTFACE 0
TEXTSIZE 12
TEXTFONT 0
PRINT"Enter size of text (min 4, max 127)"
EDIT FIELD 1,MID$ (STR$ (txtsize),2), (20,40) - (50,55),1
BUTTON 1,1,"OK",(120,30)-(170,75)
dialogactive = 0
WHILE NOT (dialogactive = 1 OR dialogactive = 6)
dialogactive = DIALOG (0)
dummy = MOUSE (0)
IF MOUSE (1) < 20 OR MOUSE (1) > 50 OR MOUSE (2) < 40 OR MOUSE
(2) > 55 THEN INITCURSOR
IF MOUSE (1) > 20 AND MOUSE (1) < 50 AND MOUSE (2) > 40 AND MOUSE
(2) < 55 THEN SETCURSOR VARPTR(textcursor(0))
WEND
txtsize = VAL(EDIT$(1))
IF txtsize <4 OR txtsize >127 THEN GOSUB wrongsize
WINDOW CLOSE 2
PUT (hstart,vstart),box
RETURN
wrongsize:
txtsize = oldtextsize
WINDOW 3,"",(hstart + 21,vstart + 55) - (hend- 14, vend + 3 ),-2
CLS
PRINT"The size must be between"
PRINT"4 AND 127 points."
BUTTON 1,1,"OK",(165,20)-(215,45)
WHILE DIALOG (0) <> 1: WEND
WINDOW CLOSE 3
RETURN returnhere
init:
DEFINT a-z
DIM cross(33),eraser(33),textcursor(33),box(1)
left = 3:top = 21:right = 507: bottom = 338
WINDOW 1,"",(left,top)-(right,bottom),3
MENU 1,0,1,"File"
MENU 1,1,1,"New Picture"
MENU 1,2,1,"Open Picture..."
MENU 1,3,1,"Save Picture..."
MENU 1,4,1,"Print Picture..."
MENU 1,5,0,"-"
MENU 1,6,1,"About Paint Simulator..."
MENU 1,7,0,"-"
MENU 1,8,1,"Quit"
MENU 2,0,1,"Edit"
MENU 2,1,1,"Copy
MENU 2,2,1,"Cut"
MENU 2,3,1,"Paste"
MENU 3,0,1,"Options"
MENU 3,1,1,"Text Size..."
MENU 3,2,0,"-"
MENU 3,3,1,"Erase"
MENU 3,4,1,"Clear Screen"
MENU 3,5,0,"-"
MENU 3,6,1,"Instructions..."
MENU 4,0,1,"Shape"
MENU 4,1,2,"Free form"
MENU 4,2,1,"Rectangle"
MENU 4,3,1,"Roundrect"
MENU 4,4,1,"Elipse"
MENU 4,5,1,"Straight Line"
MENU 4,6,0,"-"
MENU 4,7,1,"Text"
MENU 5,0,1,"Pen Size"
MENU 5,1,2,"1 by 1"
MENU 5,2,1,"2 by 2"
MENU 5,3,1,"3 by 3"
MENU 5,4,1,"4 by 4"
MENU 5,5,1,"5 by 5"
MENU 5,6,1,"6 by 6"
MENU 6,0,1,"Font"
MENU 6,1,1,"Chicago"
MENU 6,2,2,"Default"
MENU 6,3,1,"New York"
MENU 6,4,1,"Geneva"
MENU 6,5,1,"Monaco"
MENU 6,6,1,"Venice"
MENU 6,7,1,"London"
MENU 6,8,1,"Athens"
MENU 6,9,1,"San Fransisco"
MENU 6,10,1,"Toronto"
MENU 7,0,1,"Style"
MENU 7,1,2,"Plain"
MENU 7,2,1,"Bold"
MENU 7,3,1,"Italic"
MENU 7,4,1,"Underline"
MENU 7,5,1,"Outline"
MENU 7,6,1,"Shadow"
MENU 7,7,1,"Condensed"
MENU 7,8,1,"Extended"
GOSUB about
shape = 1
size = 1
face = 0
check = 1: check (1) = -1
font = 1
txtsize = 12
FOR i= 0 TO 15
cross(i)=&H100
cross(i+16)=&H0
NEXT i
cross(7)=&HFEFF
cross(32)=7
cross(33)=7
eraser(0)=&HFFFF
FOR i = 1 TO 14
eraser(i) = &H8001
NEXT I
FOR i= 15 TO 31
eraser(i)=&HFFFF
NEXT i
eraser(32)=0
eraser(33)=0
textcursor(0) = 0
textcursor(1) = 0
textcursor(2) = &H630
textcursor(3) = &H140
FOR i = 4 TO 10
textcursor (i) = &H80
NEXT
textcursor(11) = &H7F0
textcursor(12) = &H80
textcursor(13) = &H140
textcursor(14) = &H630
textcursor(15) = 0
FOR i = 16 TO 31
textcursor(i) = 0
NEXT
textcursor(32) = 11
textcursor(33) = 8
RETURN
instructions:
INITCURSOR
ERASE box
hstart = 0: vstart = 0: hend = right - left: vend = bottom - top
GOSUB dimbox
TEXTFONT 1:TEXTSIZE 12
TEXTFACE 0
WIDTH 60
BUTTON 1,1,"OK",(460,290)-(500,310)
CLS
PRINT"To draw a picture using the mouse to draw your lines or shapes,
move"
PRINT"the cursor to where you want to start drawing and press and
hold the"
PRINT"button down. Now move the mouse to draw on the screen. Drawing
ends"
PRINT"when you release the mouse button. If you want to draw more
than one"
PRINT"continuous line or shape, move the cursor to where you want
and press the"
PRINT"button; change shape as desired from the shape menu. Line
widths can be"
PRINT"changed from the size menu."
PRINT:PRINT"To copy or cut a section of the screen, choose Cut or
Copy from the Edit"
PRINT"menu. Place the cursor at a corner of the section you want
to copy or cut and"
PRINT"press the mouse button; while holding the button down, move
the cursor."
PRINT"A blinking box will outline the area you have selected. When
you have placed it where you want it,"
PRINT"release the button."
PRINT:PRINT"Click OK to continue."
WHILE DIALOG (0) <> 1:WEND
CLS
PRINT"To paste what you cut or copied, choose Paste from the Edit
menu. To"
PRINT"paste it the same size as you cut or copied it, place the cursor
where"
PRINT"you want the upper-left corner to be and click the mouse button.
To
PRINT"resize the picture, drag the rectangle as described in cut
and copy, then"
PRINT"release the button."
PRINT:PRINT"Choose Erase from the options menu to erase portions
of what you have"
PRINT"drawn. You may also clear the whole drawing window with the
Clear Screen"
PRINT"option, also in the Options menu."
PRINT:PRINT"The file menu contains options to make a new picture,
load an existing one"
PRINT"from disk, save a picture or part of one to disk, or exit the
program. When"
PRINT"you select Save Picture, use the cursor to select the portion
to save, just as"
PRINT"if you were copying it. After you choose the portion to save,
or after you"
PRINT"choose Load Picture, you will get a dialog box to specify the
name of the"
PRINT"picture to be saved or loaded."
PRINT:PRINT"Click OK to continue."
WHILE DIALOG (0) <> 1:WEND
CLS
PRINT"To enter text, choose Text from the Shape menu. You may change
the text"
PRINT"font from the Font menu, the size of the text from the Options
menu,"
PRINT"or the style from the Style menu. The Style menu works the
same as the"
PRINT"Macwrite Style menu; you can toggle a text face on and off
by clicking it."
PRINT"Pressing return generates a carriage return using the selected
left margin."
PRINT:PRINT"Click OK to return to the menu."
WHILE DIALOG (0) <> 1:WEND
CLS
BUTTON CLOSE 1
PUT (0,0),box
RETURN
about:
INITCURSOR
ERASE box
hstart = 89:vstart = 46: hend = 374: vend = 256
GOSUB dimbox
WINDOW 2,"",(100,75)-(370,270),-2
getname$ = "About..."
GOSUB info
BUTTON 1,1,"OK",(110,150)-(150,175)
WHILE DIALOG (0) <> 1 :WEND
WINDOW CLOSE 2
PUT (hstart,vstart),box
RETURN
dummy: RETURN
' Read a Pict File saved as text
WIDTH 60
OPEN "about..." FOR INPUT AS #1
OPEN "datafile" FOR OUTPUT AS #2
PRINT#2,"DATA ";
WHILE NOT EOF (1)
item$ = INPUT$(1,#1)
PRINT".";
counter = counter +1
IF counter <> 1 THEN PRINT #2,",";
IF counter <> 16 THEN PRINT#2,MID$(STR$(ASC(item$)),2);
IF counter = 16 THEN counter = 0: PRINT#2, MID$(STR$(ASC(item$)),2):PRINT#2,
"DATA ";
WEND
PRINT#2,""
CLOSE
' Create a pict file from data statements
OPEN "about..." FOR OUTPUT AS #1
WIDTH 60
ON ERROR GOTO finished
loop:
PRINT".";
READ info
PRINT #1, CHR$(info);
GOTO loop
finished:
CLOSE #1
END
DATA 9,34,0,0,0,0,1,61,1,248,17,1,1,0, 10,0
DATA 0,0,0,1,61,1,248,152,0,34,0,0,0, 0,0,196
DATA 1,13,0,0,0,0,0,196,1,13,0,0,0,0, 0,196
DATA 1,13,0,0,5,225,255,1,248,0,7,0,128,226 ,0,1
DATA 8,0,7,0,128,226,0,1,8,0,7,0,128, 226,0,1
DATA 8,0,7,0,128,226,0,1,8,0,7,0,128, 226,0,1
DATA 8,0,7,0,128,226,0,1,8,0,7,0,128, 226,0,1
DATA 8,0,7,0,128,226,0,1,15,224,7,0,128,226, 0,1
DATA 15,224,7,0,128,226,0,1,15,224,7,0,128, 226,0,1
DATA 15,224,7,0,128,226,0,1,15,224,7,0,128, 226,0,1
DATA 15,224,7,0,128,226,0,1,15,224,7,0,128, 226,0,1
DATA 15,224,7,0,128,226,0,1,15,224,7,0,128, 226,0,1
DATA 15,224,7,0,128,226,0,1,15,224,7,0,128, 226,0,1
DATA 15,224,7,0,128,226,0,1,15,224,7,0,128, 226,0,1
DATA 15,224,7,0,128,226,0,1,15,224,7,0,128, 226,0,1
DATA 15,224,7,0,128,226,0,1,15,224,7,0,128, 226,0,1
DATA 15,224,7,0,128,226,0,1,15,224,7,0,128, 226,0,1
DATA 15,224,7,0,128,226,0,1,15,224,7,0,128, 226,0,1
DATA 15,224,7,0,128,226,0,1,15,224,7,0,128, 226,0,1
DATA 15,224,7,0,128,226,0,1,15,224,7,0,128, 226,0,1
DATA 15,224,7,0,128,226,0,1,15,224,7,0,128, 226,0,1
DATA 15,224,7,0,128,226,0,1,15,224,7,0,128, 226,0,1
DATA 15,224,7,0,128,226,0,1,15,224,7,0,128, 226,0,1
DATA 15,224,7,0,128,226,0,1,15,224,7,0,128, 226,0,1
DATA 15,224,7,0,128,226,0,1,15,224,7,0,128, 226,0,1
DATA 15,224,7,0,128,226,0,1,15,224,7,0,128, 226,0,1
DATA 15,224,7,0,128,226,0,1,15,224,28,0,128, 254,0,17
DATA 1,255,248,0,0,15,240,0,48,0,0,3,248,192, 0,0
DATA 3,128,247,0,1,15,224,30,0,128,254,0,19, 1,255,252
DATA 0,0,15,248,0,48,0,48,7,248,192,0,0,3, 128,1
DATA 128,249,0,1,15,224,29,0,128,253,0,5, 195,12,0,0
DATA 6,24,254,0,2,48,6,24,254,0,3,1,128,1, 128,249
DATA 0,1,15,224,29,0,128,253,0,5,195,12,0,0, 6,24
DATA 254,0,2,48,6,24,254,0,3,1,128,1,128,249 ,0,1
DATA 15,224,31,0,128,253,0,20,195,12,62,15, 198,24,248,115
DATA 248,120,6,1,207,255,28,225,135,195,195, 231,240,251,0,1
DATA 15,224,31,0,128,253,0,20,195,12,127,31, 198,25,252,115
DATA 252,120,6,1,207,255,156,225,143,227, 199,247,248,251,0,1
DATA 15,224,31,0,128,253,0,20,195,12,99,24, 199,249,140,49
DATA 140,48,7,240,198,49,140,97,140,97,134, 51,24,251,0,1
DATA 15,224,30,0,128,253,0,19,195,12,3,24,7, 240,12,49
DATA 140,48,3,248,198,49,140,97,128,97,134, 51,250,0,1,15
DATA 224,30,0,128,253,0,19,195,12,63,24,6,0, 252,49,140
DATA 48,0,24,198,49,140,97,135,225,134,51, 250,0,1,15,224
DATA 30,0,128,253,0,19,195,12,127,24,6,1,252, 49,140,48
DATA 0,24,198,49,140,97,143,225,134,51,250, 0,1,15,224,30
DATA 0,128,253,0,19,195,12,99,24,6,1,140,49, 140,48,0
DATA 24,198,49,140,97,140,97,134,51,250,0,1, 15,224,30,0
DATA 128,253,0,19,195,12,99,24,198,1,140,49, 140,48,6,24
DATA 198,49,140,97,140,97,134,51,250,0,1,15, 224,32,0,128
DATA 254,0,21,1,231,158,127,159,207,1,254, 123,222,60,7,249
DATA 239,123,207,243,207,241,231,247,128, 251,0,1,15,224,32,0
DATA 128,254,0,21,1,231,158,63,143,207,0, 254,123,222,28,7
DATA 241,239,123,199,243,199,240,227,231, 128,251,0,1,15,224,7
DATA 0,128,226,0,1,15,224,7,0,128,226,0,1,15, 224,7
DATA 0,128,226,0,1,15,224,7,0,128,226,0,1,15, 224,7
DATA 0,128,226,0,1,15,224,7,0,128,226,0,1,15, 224,7
DATA 0,128,226,0,1,15,224,7,0,128,226,0,1,15, 224,7
DATA 0,128,226,0,1,15,224,7,0,128,226,0,1,15, 224,7
DATA 0,128,226,0,1,15,224,7,0,128,226,0,1,15, 224,7
DATA 0,128,226,0,1,15,224,7,0,128,226,0,1,15, 224,7
DATA 0,128,226,0,1,15,224,7,0,128,226,0,1,15, 224,7
DATA 0,128,226,0,1,15,224,7,0,128,226,0,1,15, 224,7
DATA 0,128,226,0,1,15,224,20,0,128,253,0,9, 124,0,4
DATA 2,102,0,0,56,96,3,240,0,1,15,224,19,0, 128,253
DATA 0,1,102,0,254,6,3,0,0,100,96,239,0,1,15, 224
DATA 23,0,128,253,0,12,102,102,7,14,102,99, 192,96,241,227
DATA 62,30,54,243,0,1,15,224,23,0,128,253,0, 8,102,102
DATA 7,158,102,198,96,112,99,254,51,0,56,243 ,0,1,15,224
DATA 23,0,128,253,0,8,124,102,5,246,103,134, 96,56,99,254
DATA 51,0,48,243,0,1,15,224,23,0,128,253,0, 12,102,102
DATA 4,230,103,7,224,28,99,243,51,63,48,243, 0,1,15,224
DATA 23,0,128,253,0,12,102,102,4,70,103,134, 0,12,99,3
DATA 51,48,48,243,0,1,15,224,23,0,128,253,0, 12,102,102
DATA 4,6,102,198,32,76,99,19,51,49,48,243,0, 1,15,224
DATA 23,0,128,253,0,12,124,62,4,6,102,99, 192,56,49,227
DATA 51,30,48,243,0,1,15,224,11,0,128,252,0, 0,6,232
DATA 0,1,15,224,11,0,128,252,0,0,70,232,0,1, 15,224
DATA 11,0,128,252,0,0,60,232,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,33,0,128,253,0,10,102,0,0,3, 0,0
DATA 3,240,31,128,30,253,0,0,48,254,0,4,6,15, 15,31
DATA 128,254,0,1,15,224,29,0,128,253,0,0, 102,251,0,3
DATA 96,1,128,51,253,0,7,48,3,15,192,14,25, 153,152,253
DATA 0,1,15,224,33,0,128,253,0,22,102,60, 108,227,30,62
DATA 0,192,1,128,51,51,31,51,28,120,7,12,0, 6,25,153
DATA 152,253,0,1,15,224,32,0,128,253,0,9, 102,102,113,147
DATA 51,51,1,224,1,128,253,51,8,50,48,3,12, 0,6,25
DATA 153,159,253,0,1,15,224,34,0,128,253,0, 10,102,102,97
DATA 195,51,51,0,48,3,0,63,254,51,9,56,48,3, 15,128
DATA 6,25,143,1,128,254,0,1,15,224,33,0,128, 253,0,9
DATA 102,126,96,227,51,51,0,48,6,0,253,51,9, 28,48,3
DATA 0,192,6,15,153,129,128,254,0,1,15,224, 33,0,128,253
DATA 0,9,102,96,96,115,51,51,0,48,6,0,253,51 ,9,14
DATA 48,3,0,192,6,1,153,129,128,254,0,1,15, 224,33,0
DATA 128,253,0,2,100,98,97,254,51,3,2,49, 134,0,253,51
DATA 9,38,48,3,0,192,6,3,25,145,128,254,0,1, 15,224
DATA 33,0,128,253,0,10,120,60,96,227,30,51, 1,225,134,0
DATA 51,254,31,8,28,24,3,8,204,6,14,15,15, 253,0,1
DATA 15,224,17,0,128,241,0,0,3,254,0,2,3,7, 140,249
DATA 0,1,15,224,15,0,128,241,0,0,35,252,0,0, 4,249
DATA 0,1,15,224,15,0,128,241,0,0,30,252,0,0, 8,249
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,7,0, 128,226
DATA 0,1,15,224,7,0,128,226,0,1,15,224,4,224, 255,0
DATA 224,4,224,255,0,224,7,1,0,15,226,255,0, 224,7,1
DATA 0,15,226,255,0,224,7,1,0,15,226,255,0, 224,7,1
DATA 0,15,226,255,0,224,7,1,0,15,226,255,0, 224,2,223
DATA 0,255,13