home *** CD-ROM | disk | FTP | other *** search
- '****************************************************************************
- ' USERFILL.BAS
- '
- ' This sample program demonstrates the user defined fill patterns.
- '****************************************************************************
- '$INCLUDE: 'PGL.BAS'
-
- dfile$="USERFILL.PLT"
- DIM fillstyle(3) AS STRING*25
- DIM userfill%(3,2)
- DIM oldfill%(3,2)
-
- fillstyle(0) = "FILL 1"
- fillstyle(1) = "FILL 2"
- fillstyle(2) = "FILL 3"
-
- ' Set up user fill patterns in Column Major order
- userfill%(0,0)=&H80FF : userfill%(1,0)=&H8080
- userfill%(2,0)=&H08FF : userfill%(3,0)=&H0808
-
- userfill%(0,1)=&H88FF : userfill%(1,1)=&H8888
- userfill%(2,1)=&H08FF : userfill%(3,1)=&H0808
-
- userfill%(0,2)=&H08FF : userfill%(1,2)=&H0808
- userfill%(2,2)=&H08FF : userfill%(3,2)=&H0808
-
-
- ' **** UserFill main procedure ****
- '
- ' Open A Drawing File.
- '
- call pgInitDrw( dfile$, 4000, 3000, ierr% )
- if ierr% <> 0 then
- print "Error Opening Drawing File: " + dfile$ + " !"
- goto exitpgm
- endif
-
- call pgSetTextStyle( pgTRIPLEX )
- call pgSetTextJustify( pgCENTER, pgTOP )
- call pgSetCharSpacing( 3 )
- call pgSetTextScaling( 2, 1, 2, 1 )
- call pgSetColor( 15 )
-
- ' Set fill patterns using userfill patterns
- FOR j% = 0 TO 2
- dx% = j% * 1000
- call pgSetFillPattern( userfill%(0,j%), 1 )
- call pgRectangle( 100+dx%, 100, 900+dx%, 900, pgOFILL )
- call pgDrawTextXY( 500+dx%, 920, fillstyle$(j%) )
- call pgGetFillPattern( oldfill%(0,j%), 1 )
- NEXT
-
- ' Set fill patterns using oldfill patterns
- FOR j% = 0 TO 2
- dx% = j% * 1000
- call pgSetFillPattern( oldfill%(0,j%), 1 )
- call pgRectangle( 100+dx%, 1100, 900+dx%, 1900, pgOFILL )
- call pgDrawTextXY( 500+dx%, 1920, fillstyle$(j%) )
- NEXT
-
- ' Close The Drawing File.
- call pgEndDrw
-
- exitpgm:
- end