获取指定位图尺寸
#Include <WinAPIEx.au3>
_WinAPI_GetBitmapDimension ( $hBitmap )
$hBitmap | 要获取尺寸的位图的句柄 |
成功: | 返回包含位图尺寸的 $tagSIZE 结构. |
失败: | 返回 0 并设置@error非0 |
#Include <APIConstants.au3>
#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global $tSIZE, $hBitmap
$hBitmap = _WinAPI_LoadImage(0, @ScriptDir & '\Extras\Logo.bmp', $IMAGE_BITMAP, 0, 0, $LR_LOADFROMFILE)
$tSIZE = _WinAPI_GetBitmapDimension($hBitmap)
_WinAPI_DeleteObject($hBitmap)
ConsoleWrite(DllStructGetData($tSIZE, 'X') & ' x ' & DllStructGetData($tSIZE, 'Y') & @CR)