home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / hdf / unix / examples.lha / examples / ris8 / getputimF.f < prev    next >
Encoding:
Text File  |  1991-10-03  |  1.1 KB  |  34 lines

  1.  
  2.       program getputim
  3. C
  4. C Program to illustrate use of d8gdims, d8gimg and d8aimg
  5. C
  6. C  Files needed:  old.hdf (look in "files" directory)
  7. C  Files created: new.hdf
  8. C  The image that is moved from old.hdf to new.hdf contains the sectrum
  9. C     of colors, moving from to to bottom, with ten vertical and ten
  10. C     horizontal lines cross-hatched.
  11. C
  12. C****||************************************************************
  13.       integer d8gdims, d8gimg, d8aimg
  14.       integer ispal, ret, width, height
  15.  
  16.       character*1 image(200,150), pal(768)
  17.  
  18. C****||********* read in image ******************
  19.       ret = d8gdims('old.hdf', width, height, ispal)
  20.       if ( (width.eq.200) .and. (height.eq.150) ) then
  21.          ret = d8gimg('old.hdf',image,width,height,pal)
  22.          print *,'ret=',ret
  23.       else
  24.          print *, 'width=',width, '    height=',height
  25.          print *, 'Wrong dimensions.  Program aborted.'
  26.          stop
  27.       endif
  28.  
  29. C****||************ write same image to different file ************
  30.       ret = d8aimg('new.hdf', image, width, height, ispal)
  31.  
  32.       stop
  33.       end
  34.