0010  // Vis IFF-billeder, der er lagret på disk
0020
0030  // Det er kun en demonstration, så man kan ikke regne
0040  // med, at dette program reagerer fornuftigt på unor-
0050  // male billedformater.
0060
0070 USE GRAPHICS_LIBRARY
0080 USE IFF
0090 USE SCREENS
0100 USE GFX
0110 USE VIEW
0120
0130 DIM colortable%(0:127)
0140
0150 POINTER newscr@ TO newscreen@
0160 POINTER scr@ TO screen@
0170 POINTER bmhd@ TO bitmapheader@
0180
0190 INPUT "Angiv navnet på billed-filen: ": iff_navn$
0200
0210 ifffile#:=pckopeniff(^iff_navn$+4)
0220 IF ifffile#=0 THEN REPORT 1205
0230 ^bmhd@:=pckgetbmhd(ifffile#)
0240 IF ^bmhd@=0 THEN clean'up
0250 newscreen@.type%:=customscreen%
0260 scrtitle$:="AmigaCOMAL ShowIFF"
0270 newscreen@.defaulttitle#:=^scrtitle$+4
0280 newscreen@.width%:=bmhd@.w%
0290 newscreen@.height%:=bmhd@.h%
0300 newscreen@.depth%:=bmhd@.nplanes!
0310 newscreen@.viewmodes%:=pckgetviewmodes(ifffile#)
0320 ^scr@:=openscreen(^newscreen@)
0330 IF ^scr@=0 THEN
0340   clean'up
0350   REPORT 500,"Kan ikke åbne screen"
0360   STOP
0370 ENDIF
0380
0390 count#:=pckgetcolortab(ifffile#,^colortable%())
0440 pckloadrgb4(^scr@.viewport@,^colortable%(),count#)
0460 IF pckdecodepic(ifffile#,^scr@.bitmap@)=0 THEN
0470   clean'up
0480   REPORT 501,"For mange bitplaner"
0490   STOP
0500 ENDIF
0510
0520 WAIT
0530 clean'up
0540
0550 PROC clean'up
0560   closeallscreens
0570   pckcloseiff(ifffile#)
0580 ENDPROC clean'up
