WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Bitmaps and Clipboard

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How to Return the Pixel Dimensions and Depth of a Bitmap

Keywords:  bitmap dimensions

Question:

Do you know of a way to return the pixel dimensions and depth (no. of colors) of a .BMP file? I realize that this is a long shot, but what the heck, thought I'd ask anyway. Thanks.

Answer:

   bmp="C:\someplace\beachcliffs.bmp"

   bb=BinaryAlloc(30)
   BinaryReadEx(bb,0,bmp,0,30)
   height=BinaryPeek4(bb,18)
   width=BinaryPeek4(bb,22)
   colordepth=BinaryPeek2(bb,28)
   BinaryFree(bb)
   Message(bmp,StrCat("Height=",height,@CRLF,"Width=",width,@CRLF,"colordepth=",colordepth))





Article ID:   W12745
Filename:   How to Return Bitmap Dimensions.txt
File Created: 2004:07:26:10:40:30
Last Updated: 2004:07:26:10:40:30