'=========================================================================== ' Subject: USING DRAW AND VARPTR$ Date: 08-15-00 (15:47) ' Author: Jacob Wieles Code: QB, QBasic, PDS, PB ' Origin: j.wieles@hccnet.nl Packet: GRAPHICS.ABC '=========================================================================== 'program : VARPDRAW.BAS (15-08-2000) 'auteur : Jacob Wieles ' Playing with DRAW and VARPTR$ 'basic : PowerBASIC en Q(uick)Basic ' : If you have the two basics then you find a differend ' moire pattern on the same pictures. ' : With PowerBasic the looks better defint a-z screen 12 'Find out on which basic the program runs out &H3C7,15 cr=inp(&H3C9) cg=inp(&H3C9) cb=inp(&H3C9) ' if cr=42 then the program runs on PowerBasic ' if cr=63 then the program runs on Q(uick)Basic timedivisor=100'=====================>> For PowerBASIC if cr=63 then timedivisor=8'=========>> For Q(uick)BASIC 'The value for the timedivisor are found for a Pentium 100 PC 'For an other PC maybe you must change this value 'To prevent flickering monitor and SetUpDrawSpeed t!=timer wp&=0 do while timer< t!+1 wp&=wp&+1 loop DrawLoop&=wp&/timedivisor xm=point(0) ym=point(1) window (xm-1,ym-1)-(-xm,-ym) for i=1 to 90 pset(0,70) X=3*i-10 Y=2*i-30 angle=i-30 linecol=i mod 5 + 10 gosub DrawPicture1 for w&=0 to DrawLoop&:next w& angle=-angle gosub DrawPicture1 for w&=0 to DrawLoop&:next w& next i locate 1,1 print" Hit a key for next." hitkey$=input$(1) cls for i=1 to 80 pset(0,0) X=i*3-30 Y=i*2 angle=i linecol=i mod 5 + 10 gosub DrawPicture2 for w&=0 to DrawLoop&:next w& angle=-angle gosub DrawPicture2 for w&=0 to DrawLoop&:next w& next i while inkey$<>"":wend locate 1,1 print" Hit a key for end." hitkey$=input$(1) QuitProg: cls screen 0 print" Hit a key for the source." end DrawPicture1: draw"TA="+VARPTR$(angle)+"C="+VARPTR$(linecol) draw"M+="+VARPTR$(X)+",+="+VARPTR$(Y) draw"M-="+VARPTR$(X)+",+="+VARPTR$(Y) draw"M-="+VARPTR$(X)+",-="+VARPTR$(Y) draw"M+="+VARPTR$(X)+",-="+VARPTR$(Y) return DrawPicture2: draw"TA="+VARPTR$(angle)+"C="+VARPTR$(linecol) draw"M+="+VARPTR$(X)+",+="+VARPTR$(Y) draw"M-="+VARPTR$(X)+",+="+VARPTR$(Y) draw"M-="+VARPTR$(X)+",-="+VARPTR$(Y) draw"M+="+VARPTR$(X)+",-="+VARPTR$(Y) draw"M+="+VARPTR$(X)+",-="+VARPTR$(Y) draw"M-="+VARPTR$(X)+",-="+VARPTR$(Y) draw"M-="+VARPTR$(X)+",+="+VARPTR$(Y) draw"M+="+VARPTR$(X)+",+="+VARPTR$(Y) return