现在的位置: 首页 > 综合 > 正文

This tip shows how to extract the width and height from a bitmap source file on disk.

2013年02月03日 ⁄ 综合 ⁄ 共 343字 ⁄ 字号 评论关闭

This tip shows how to extract the width and height from a bitmap source file on disk.
// Width and height of a picture inside a BMP file
int job
blob b
ulong width, height

job = FileOpen( "filename.bmp", StreamMode!, Read! )
FileRead( job, b )
width  = Long( Integer( BlobMid( b, 19, 2 ) ), &
   Integer( BlobMid( b, 21, 2) ) )
height = Long( Integer( BlobMid( b, 23, 2 ) ), &
   Integer( BlobMid( b, 25, 2) ) )
FileClose( job )

 

抱歉!评论已关闭.