Getting the size of a bitmap 
Author Message
 Getting the size of a bitmap

Hello,
    I need to find a way to locate the size of a bitmap in inches or
centimeters.  I have tried checking BITMAPINFOHEADER biXPel{*filter*}eter, but it
seems to vary, depending on the screen resolution.  Is there a way to
determine, based on whatever the current screen resolution is, how big the
image will be?
    The purpose of this is to display the bitmap over an area of a
predefined size, say ten inches.  That way the user can see how big the
bitmap is, in comparison to the ten inch area.

    Any ideas or suggestions would be very helpful.  Thanks in advance.


    http://www.*-*-*.com/



Mon, 09 Jul 2001 03:00:00 GMT  
 Getting the size of a bitmap
You can use GetDeviceCaps() to get:

HORZSIZE Width, in millimeters, of the physical screen.
VERTSIZE Height, in millimeters, of the physical screen.
HORZRES Width, in pixels, of the screen.
VERTRES Height, in raster lines, of the screen.

This info, along with the x and y resolution of the bitmap, should get you
what you need.

Hope this helps,

Mike.



Quote:
> Hello,
>     I need to find a way to locate the size of a bitmap in inches or
> centimeters.  I have tried checking BITMAPINFOHEADER biXPel{*filter*}eter, but
it
> seems to vary, depending on the screen resolution.  Is there a way to
> determine, based on whatever the current screen resolution is, how big
the
> image will be?
>     The purpose of this is to display the bitmap over an area of a
> predefined size, say ten inches.  That way the user can see how big the
> bitmap is, in comparison to the ten inch area.

>     Any ideas or suggestions would be very helpful.  Thanks in advance.


>     http://www.*-*-*.com/



Mon, 09 Jul 2001 03:00:00 GMT  
 Getting the size of a bitmap
There is no bitmap size in real-world coordinates. As a bitmap consist of
pixels, the size in inches/centimeters will depend on the pixel size of the
target device.
To get the number of pixels for a device, use the CDC member GetDeviceCaps
with - for example - LOGPIXELSX as the index. This will make it possible to
match screen output w printer output, for example.

Johan Rosengren
Responsabel Informatique
PACTA S.A.



Wed, 11 Jul 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Getting BitMap Size

2. bitmap size and windows font size

3. Icon to Bitmap, which icon size being copied?

4. Getting the RGB data as an array out of Bitmap

5. Getting a bitmap of a page

6. Full-size screen bitmap

7. Getting window bitmap

8. Adjusting size of bitmap before storing to file (HDIB available)

9. Hoc can I get bitmap size

10. Getting a bitmap of a page

11. Bitmap Sizing

12. Getting a section of a bitmap (from a CBitmap)

 

 
Powered by phpBB® Forum Software