'**************************************
'                                     *
'     IntuiExtend.Lib 2.0/@1995-98    *
'                                     *
'          by CIERP Philippe.         *
'                                     *
'          from AMIGAzette 83         *
'                                     *
'**************************************
'
' Command  
'  -Iff Open Read
'  -Iff Get Error
'  -Iff Get Vmode
'  -Iff Get Width
'  -Iff Get Height   
'  -Iff Get Xpos   
'  -Iff Get Ypos   
'  -Iff Get Depth    
'  -Wb Depth To Colour 
'  -Amos Rastport
'  -Iff Decode Picture 
'  -Iff Close
'
' Ouverture de l'image en lecture  
A$=Fsel$("")+Chr$(0)
_IFF=Iff Open Read(A$)
'
If _IFF<=0
   ERR0R=Iff Get Error
   Print ERR0R
   Iff Close _IFF
   End 
End If 
'
' Prendre le mode video (ViewMode > EHB, HAM6, HAM8, Lace, Hires etc...) 
VMODE=Iff Get Vmode(_IFF)
'
' Prise des informations dans le BMHD  
WIDTH=Iff Get Width(_IFF)
HEIGHT=Iff Get Height(_IFF)
XPOS=Iff Get Xpos(_IFF)
YPOS=Iff Get Ypos(_IFF)
DEPTH=Iff Get Depth(_IFF)
_COL_NB=Wb Depth To Colour(DEPTH)

' Ouvre un ecran Amos... 
Screen Open 0,WIDTH,HEIGHT,_COL_NB,VMODE
Curs Off : Flash Off : Cls 0
'
' Reserver le buffer pour la palette de l'image
Reserve As Work 998,256*2 : CTABLE=Start(998)
'
' Convertion du CMAP en palette. 
_COLOR_MAX=Iff Get Ctable(_IFF,CTABLE)
'
' Affecter la palette a l'écran Amos 
For T=0 To _COL_NB-1
   Colour T,Deek(CTABLE+(T*2))
Next T
'
' Afficher l'image 
RES=Iff Decode Picture(_IFF,Amos Rastport)
Iff Close _IFF
'
While Mouse Key<>2 : Wend 
