home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 4 / AACD04.ISO / AACD / Programming / envsof20 / source / create_preview_png.pprx < prev    next >
Encoding:
Text File  |  1999-08-31  |  947 b   |  40 lines

  1. /*
  2.  * create_preview_png.pprx - Convert Preview image to PNG using PPaint.
  3.  *
  4.  * $VER: create_preview_png.pprx 1.0 (31.8.99)
  5.  *
  6.  * Copyright 1999 Thomas Aglassinger and others, see file "forum.txt"
  7.  */
  8. directory = 'prog:envSOFxx/'
  9.  
  10. /* Come up with PPaint*/
  11. PPPORT = 'PPAINT'
  12. IF ~SHOW('P', PPPORT) THEN DO
  13.    IF EXISTS('PPaint:PPaint') THEN DO
  14.       ADDRESS COMMAND 'Run >NIL: PPaint:PPaint'
  15.       DO 30 WHILE ~SHOW('P',PPPORT)
  16.           ADDRESS COMMAND 'Wait >NIL: 1 SEC'
  17.       END
  18.    END
  19.    ELSE DO
  20.       SAY "Personal Paint could not be loaded."
  21.       EXIT 10
  22.    END
  23. END
  24.  
  25. IF ~SHOW('P', PPPORT) THEN DO
  26.    SAY 'Personal Paint Rexx port could not be opened'
  27.    EXIT 10
  28. END
  29.  
  30. ADDRESS VALUE PPPORT
  31. OPTIONS RESULTS
  32.  
  33. if 1 then do
  34.    'LoadImage File ' || directory || 'Preview Force'
  35.    'SaveImage File ' || directory || 'preview.png Format=PNG'
  36.    /* Find something to resize */
  37.    'SaveImage File ' || directory || 'preview_small.png Format=PNG'
  38. end
  39.  
  40.