WinIconRdr.st
changeset 692 e6af4c70e066
parent 678 26ff1d0b739c
child 713 548898fdd1dc
equal deleted inserted replaced
691:bb5dfbec2a7a 692:e6af4c70e066
    71     inStream := self streamReadingFile:aFileName.
    71     inStream := self streamReadingFile:aFileName.
    72     inStream isNil ifTrue:[^ false].
    72     inStream isNil ifTrue:[^ false].
    73 
    73 
    74     inStream binary.
    74     inStream binary.
    75     ok := false.
    75     ok := false.
    76     inStream size > 16 ifTrue:[
    76     inStream fileSize > 16 ifTrue:[
    77         header := ByteArray uninitializedNew:4.
    77         header := ByteArray uninitializedNew:4.
    78         inStream nextBytes:4 into:header.
    78         inStream nextBytes:4 into:header.
    79 
    79 
    80         (header startsWith:#(66 77)) ifTrue:[     "BM"
    80         (header startsWith:#(66 77)) ifTrue:[     "BM"
    81             ok := true.
    81             ok := true.
   308     |fileSize header|
   308     |fileSize header|
   309 
   309 
   310     inStream := aStream.
   310     inStream := aStream.
   311 
   311 
   312     aStream binary.
   312     aStream binary.
   313     fileSize := aStream size.
   313     fileSize := aStream fileSize.
   314 
   314 
   315     fileSize < 16 ifTrue:[
   315     fileSize < 16 ifTrue:[
   316         'WinIconReader [warning]: short file' infoPrintNL.
   316         'WinIconReader [warning]: short file' infoPrintNL.
   317         ^ nil
   317         ^ nil
   318     ].
   318     ].
   398       bytesPerRow fourBytesPerColorInfo|
   398       bytesPerRow fourBytesPerColorInfo|
   399 
   399 
   400     inStream := aStream.
   400     inStream := aStream.
   401     aStream binary.
   401     aStream binary.
   402 
   402 
   403     fileSize := aStream size.
   403     fileSize := aStream fileSize.
   404     "read the header"
   404     "read the header"
   405 
   405 
   406     header := ByteArray uninitializedNew:16r54.
   406     header := ByteArray uninitializedNew:16r54.
   407     aStream nextBytes:18 into:header.
   407     aStream nextBytes:18 into:header.
   408 
   408 
   666 ! !
   666 ! !
   667 
   667 
   668 !WindowsIconReader class methodsFor:'documentation'!
   668 !WindowsIconReader class methodsFor:'documentation'!
   669 
   669 
   670 version
   670 version
   671     ^ '$Header: /cvs/stx/stx/libview2/Attic/WinIconRdr.st,v 1.35 1997-07-28 10:57:41 cg Exp $'
   671     ^ '$Header: /cvs/stx/stx/libview2/Attic/WinIconRdr.st,v 1.36 1997-09-10 21:28:18 cg Exp $'
   672 ! !
   672 ! !
   673 WindowsIconReader initialize!
   673 WindowsIconReader initialize!