home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxgd101.zip / sample.cmd < prev    next >
OS/2 REXX Batch file  |  1997-09-23  |  3KB  |  113 lines

  1. /* Image File support code test */
  2. /* Just a bunch of rexx calls   */
  3. /* to test the code             */
  4.  
  5. Call RxFuncAdd 'RxgdLoadFuncs', 'RXGDUTIL', 'RxgdLoadFuncs'
  6.  
  7. Call RxgdLoadFuncs
  8.  
  9.   im = RxgdImageCreate(500, 350)
  10.   say 'RxgdImageCreate rc = ' im
  11.   en = RxgdImageCreateFromGIF("env.gif")
  12.   say 'RxgdImageCreateFromGIF rc = ' en
  13.  
  14.   brush = RxgdImageSetBrush(im, en)
  15.   say 'RxgdImageSetBrush brush = ' brush
  16.   tile  = RxgdImageSetTile(im, en)
  17.   say 'RxgdImageSetTile tile = ' tile
  18.  
  19.   s.0 = 0
  20.   s.1 = 0
  21.   s.2 = 0
  22.   s.3 = 0
  23.   s.4 = 0
  24.   s.5 = 0
  25.   s.6 = 0
  26.   s.7 = 0
  27.   s.8 = 0
  28.   s.9 = 0
  29.   s.10= 1
  30.   styled  = RxgdImageSetStyle(im, s, 11)
  31.   say 'RxgdImageSetStyle style = ' styled
  32.  
  33.   styledbrush  = RxgdImageGetStyledBrushed(im, s, 11)
  34.   say 'RxgdImageGetStyleBrushed stylebrush = ' styledbrush
  35.  
  36.   black = RxgdImageColorAllocate(im, 0, 0, 0,)
  37.   white = RxgdImageColorAllocate(im, 255, 255, 255)
  38.   gray  = RxgdImageColorAllocate(im, 128, 128, 128)
  39.   red   = RxgdImageColorAllocate(im, 255, 0, 0)
  40.   green = RxgdImageColorAllocate(im, 0, 255, 0)
  41.   blue  = RxgdImageColorAllocate(im, 0, 0, 255)
  42.  
  43.   rc = RxgdImageFill(im, 0, 0, gray)
  44.   say 'RxgdImageFill rc = ' rc
  45.  
  46.   rc = RxgdImageSetPixel(im, 1, 1, black)
  47.   say 'RxgdImageSetPixel rc = ' rc
  48.  
  49.   rc = RxgdImageLine(im, 200, 50, 450, 50, white)
  50.   say 'RxgdImageLine rc = ' rc
  51.  
  52.   rc = RxgdImageLine(im, 200, 200, 300, 200, brush)
  53.   say 'RxgdImageLine w/ brush rc = ' rc
  54.  
  55.   rc = RxgdImageLine(im, 220, 150, 275, 220, styledbrush)
  56.   say 'RxgdImageLine w/ styledbrush rc = ' rc
  57.  
  58.   rc = RxgdImageFilledRectangle(im, 375, 200, 475, 300, tile)
  59.   say 'RxgdImageFilledRectangle rc = ' rc
  60.  
  61.   poly.0 = 50
  62.   poly.1 = 50
  63.   poly.2 = 220
  64.   poly.3 = 99
  65.   poly.4 = 220
  66.   poly.5 = 220
  67.   poly.6 = 120
  68.   poly.7 = 220
  69.   rc = RxgdImagePolygon(im, poly, 4, blue)
  70.   say 'RxgdImagePolygon rc = ' rc
  71.  
  72.   poly.0 = 50
  73.   poly.1 = 0
  74.   poly.2 = 99
  75.   poly.3 = 99
  76.   poly.4 = 0
  77.   poly.5 = 99
  78.   rc = RxgdImageFilledPolygon(im, poly, 3, green)
  79.   say 'RxgdImagePolygon rc = ' rc
  80.  
  81.   rc = RxgdImageRectangle(im, 110, 110, 130, 130, red)
  82.   say 'RxgdImageRectangle rc = ' rc
  83.  
  84.   rc = RxgdImageFilledRectangle(im, 140, 225, 170, 275, blue)
  85.   say 'RxgdImageFilledRectangle rc = ' rc
  86.  
  87.   rc = RxgdImageArc(im,425,150, 77, 77, 0, 360, green)
  88.   say 'RxgdImageArc rc = ' rc
  89.  
  90.   rc = RxgdImageString(im, 'T', 10, 10, 'Tiny Hello World', black)
  91.   say 'RxgdImageString rc = ' rc
  92.   rc = RxgdImageString(im, 'S', 10, 40, 'Small Hello World', black)
  93.   say 'RxgdImageString rc = ' rc
  94.   rc = RxgdImageStringUp(im, 'M', 475, 300, 'Med Bold Hello World', black)
  95.   say 'RxgdImageStringUp rc = ' rc
  96.   rc = RxgdImageString(im, 'L', 10, 100, 'Large Hello World', black)
  97.   say 'RxgdImageString rc = ' rc
  98.   rc = RxgdImageString(im, 'G', 10, 150, 'Giant Hello World', black)
  99.   say 'RxgdImageString rc = ' rc
  100.  
  101.  
  102.   rc = RxgdImageGIF(im, "AndyNEW.GIF")
  103.   say 'RxgdImageGIF rc = ' rc
  104.  
  105.   rc = RxgdImageDestroy(im)
  106.   say 'RxgdImageDestroy(im) = ' rc
  107.  
  108.   rc = RxgdImageDestroy(en)
  109.   say 'RxgdImageDestroy(en) = ' rc
  110.  
  111.   Call RxgdUnloadFuncs
  112.   Call RxFuncDrop 'RxgdLoadFuncs'
  113.