|
PLOT AREAのSET AREA STYLE文ではHATCHパターンを
6通りの指定ができますが、下記のように色番号を置き換えることで
自由に定義することができます。
リアルタイム描画(アニメーション)はできませんが、印刷目的(プリンターがモノクロ等)なら利用できると
思います。
RANDOMIZE
SET POINT STYLE 1
FOR I=1 TO 100
LET X=RND
LET Y=RND
LET R=RND*.1
LET C=INT(RND*12)+1
CALL CIRCLEFULL(X,Y,R,C)
NEXT I
!'SET DRAW MODE HIDDEN
CALL TILEPAINT
!'SET DRAW MODE EXPLICIT
END
EXTERNAL SUB TILEPAINT
OPTION BASE 0
DIM C(255,30,30),XC(255),YC(255)
MAT XC=(1)*CON
MAT YC=(1)*CON
FOR I=0 TO 255
LET C(I,0,0)=I
NEXT I
DO
READ IF MISSING THEN EXIT DO:CC
READ XC(CC),YC(CC)
FOR J=0 TO YC(CC)-1
FOR I=0 TO XC(CC)-1
READ C(CC,I,J)
NEXT I
NEXT J
LOOP
DATA 0 !'置き換える色
DATA 12,5 !'サイズ
DATA 0,0,0,0,0,0,0,0,0,0,3,3 !'パターン定義(色番号)
DATA 0,0,0,0,0,0,0,0,3,3,0,0
DATA 0,0,0,0,0,3,3,3,0,0,0,0
DATA 0,0,3,3,3,0,0,0,0,0,0,0
DATA 3,3,0,0,0,0,0,0,0,0,0,0
DATA 1
DATA 5,1
DATA 1,0,0,0,0
DATA 2
DATA 5,5
DATA 1,0,0,0,0
DATA 0,1,0,0,0
DATA 0,0,1,0,0
DATA 0,0,0,1,0
DATA 0,0,0,0,1
DATA 3
DATA 7,7
DATA 0,0,0,0,0,0,0
DATA 0,0,0,1,0,0,0
DATA 0,0,0,1,0,0,0
DATA 0,1,1,1,1,1,0
DATA 0,0,0,1,0,0,0
DATA 0,0,0,1,0,0,0
DATA 0,0,0,0,0,0,0
DATA 4
DATA 8,8
DATA 1,1,1,1,0,0,0,0
DATA 1,1,1,1,0,0,0,0
DATA 1,1,1,1,0,0,0,0
DATA 1,1,1,1,0,0,0,0
DATA 0,0,0,0,1,1,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0,0,0
DATA 0,4,0,0,0,4
DATA 0,0,4,0,4,0
DATA 0,0,0,4,0,0
DATA 0,0,0,0,0,0
DATA 10
DATA 5,5
DATA 0,0,2,0,0
DATA 0,0,2,0,0
DATA 2,2,2,2,2
DATA 0,0,2,0,0
DATA 0,0,2,0,0
ASK BITMAP SIZE XSIZE,YSIZE
FOR Y=0 TO YSIZE
FOR X=0 TO XSIZE
LET XX=WORLDX(X)
LET YY=WORLDY(YSIZE-Y)
LET CC=GETPOINT(XX,YY)
IF CC<>-1 THEN CALL PSET(XX,YY,C(CC,MOD(X,XC(CC)),MOD(Y,YC(CC))))
NEXT X
NEXT Y
END SUB
EXTERNAL SUB PSET(X,Y,C)
SET POINT COLOR C
PLOT POINTS:X,Y
END SUB
EXTERNAL FUNCTION GETPOINT(X,Y)
ASK PIXEL VALUE(X,Y) C
LET GETPOINT=C
END FUNCTION
EXTERNAL SUB CIRCLEFULL(X,Y,RR,C)
SET COLOR C
DRAW DISK WITH SCALE(RR)*SHIFT(X,Y)
END SUB
|
|