16-bit BMP check

I am developing a script using VBScript and I need to check the input file as BMP with 16 bits.

At that time, my script looks like this:

Const OverwriteExisting = TRUE

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "C:\16bmp.bmp" , "D:\test.bmp", OverwriteExisting

But how can I check the input file as BMP with 16 bits?



PS: Remember that I need it to be compatible with my site and Windows CE (I will develop a program for it that uses NSBasic).

+3
source share
2 answers

, ( - ), , 16- BMP- ( ), Windows Image Acquisition (WIA). :

Const wiaIDUnknown = "{00000000-0000-0000-0000-000000000000}"
Const wiaFormatBMP = "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}"

Set oImg = CreateObject("Wia.ImageFile")

On Error Resume Next

oImg.LoadFile("C:\image.bmp")

If oImg.FormatID = wiaIDUnknown Then
  ' The file isn't an image file
Else
  Log.Message "Is BMP: " & (oImg.FormatID = wiaFormatBMP)
  Log.Message "Color depth: " & oImg.PixelDepth
End If

script , ​​ wiaaut.dll; , WIA SDK.

. WIA MSDN.

+2

BMP.

VBScript:

+1

Source: https://habr.com/ru/post/1734776/


All Articles