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 )
本文介绍了一种从BMP格式文件中提取图片宽度和高度的方法。通过打开文件并读取特定位置的数据,可以解析出图片的实际尺寸。

被折叠的 条评论
为什么被折叠?



