home *** CD-ROM | disk | FTP | other *** search
- '****************************************************************************
- ' GEOM.BAS
- '
- ' This sample program demonstrates the supported PGL geometries.
- '****************************************************************************
- '$INCLUDE: 'PGL.BAS'
-
- dfile$="GEOM.PLT"
- DIM polydata(11) AS INTEGER
- DIM pdata(11) AS INTEGER
- polydata(0)= 500:polydata(1)= 200 :polydata(2)=100: polydata(3)=400
- polydata(4)= 300:polydata(5)= 800 :polydata(6)=600: polydata(7)=600
- polydata(8)= 900:polydata(9)= 700 :polydata(10)=750: polydata(11)=300
-
- ' **** FillPat main procedure ****
- '
- ' Open A Drawing File.
- '
- call pgInitDrw( dfile$, 3001, 3001, ierr% )
- if ierr% <> 0 then
- print "Error Opening Drawing File: " + dfile$ + " !"
- goto exitpgm
- endif
-
- call pgSetTextStyle( pgTRIPLEX )
- call pgSetTextJustify( pgCENTER, pgBOTTOM )
- call pgSetCharSpacing( 3 )
- call pgSetTextScaling( 2, 1, 2, 1 )
- call pgSetColor( 15 )
-
- call pgRectangle( 0, 0, 3000, 3000, pgOUTLINE )
- call pgLine( 0, 1000, 3000, 1000 )
- call pgLine( 0, 2000, 3000, 2000 )
- call pgLine( 1000, 0, 1000, 3000 )
- call pgLine( 2000, 0, 2000, 3000 )
-
- ' 1
- call pgArc( 500, 500, 300, 0, 210 )
- call pgDrawTextXY( 500, 990, "ARC" )
-
- ' 2
- call pgSetFillStyle( 2, 1 )
- call pgCircle( 1500, 500, 300, pgOFILL )
- call pgDrawTextXY( 1500, 990, "CIRCLE" )
-
- ' 3
- call pgEllArc( 2500, 500, 400, 300, 0, 210 )
- call pgDrawTextXY( 2500, 990, "ELLARC" )
-
- ' 4
- call pgSetFillStyle( 3, 1 )
- call pgEllipse( 500, 1500, 400, 300, pgOFILL )
- call pgDrawTextXY( 500, 1990, "ELLIPSE" )
-
- ' 5
- call pgSetFillStyle( 4, 1 )
- call pgPie( 1500, 1500, 300, 0, 240, pgOFILL )
- call pgDrawTextXY( 1500, 1990, "PIE" )
-
- ' 6
- j%=0
- DO While j% < 11
- pdata(j%) = polydata(j%) + 2000
- pdata(j%+1) = polydata(j%+1) + 1000
- j%=j%+2
- LOOP
- call pgSetFillStyle( 5, 1 )
- call pgPolyLine( pdata(0), 6 )
- call pgDrawTextXY( 2500, 1990, "POLYLINE" )
-
- ' 7
- j%=0
- DO While j% < 11
- pdata(j%) = polydata(j%) + 0
- pdata(j%+1) = polydata(j%+1) + 2000
- j%=j%+2
- LOOP
- call pgSetFillStyle( 6, 1 )
- call pgPolygon( pdata(0), 6, pgOFILL )
- call pgDrawTextXY( 500, 2990, "POLYGON" )
-
- ' 8
- call pgSetFillStyle( 7, 1 )
- call pgRectangle( 1500-400, 2500-300, 1500+400, 2500+300, pgOFILL )
- call pgDrawTextXY( 1500, 2990, "RECTANGLE" )
-
- ' 9
- call pgSetFillStyle( 8, 1 )
- call pgSector( 2500, 2500, 400, 300, 0, 300, pgOFILL )
- call pgDrawTextXY( 2500, 2990, "SECTOR" )
-
- ' Close The Drawing File.
- call pgEndDrw
-
- exitpgm:
- end