Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Image Width and Height Info

Robbie VRobbie V Member Posts: 1
Good Day Guys and Girls.

I am new to C++VC++ and I am still reading and styding my arse off to learn the app. I am currently working on a simple program which basically sortes images based on their width and height.

The app creates 2 folders, 1 for images smaller than 800x600 and the other for the rest of the images. Creating the folders is easy, but my problem now is reading image dimensions from the images them selfs. I am not working with any specific format, and don't need to view the images. I would just like to sort the images based on their dimensions.

Their are ASP/JAVA/PHP and what not scripts out there but I have not had any luck with VC++C++. Any suggestions and help would be appreciated.

Thanks.

Comments

  • veliusvelius Member Posts: 456
    : Good Day Guys and Girls.
    :
    : I am new to C++VC++ and I am still reading and styding my arse off
    : to learn the app. I am currently working on a simple program which
    : basically sortes images based on their width and height.
    :
    : The app creates 2 folders, 1 for images smaller than 800x600 and the
    : other for the rest of the images. Creating the folders is easy, but
    : my problem now is reading image dimensions from the images them
    : selfs. I am not working with any specific format, and don't need to
    : view the images. I would just like to sort the images based on their
    : dimensions.
    :
    : Their are ASP/JAVA/PHP and what not scripts out there but I have not
    : had any luck with VC++C++. Any suggestions and help would be
    : appreciated.
    :
    : Thanks.
    :

    You need to use GetBitmapDimensionEx() function to gain the dimensions of each image file.

    [link=http://msdn2.microsoft.com/en-us/library/ms532288.aspx]GetBitmapDimensionEx()[/link]

    Should contain everything you'll need to know to use it.
    [hr]
    We'll be an army of theives
    Of self-freed slaves
    Of mild-mannered maids
    We'll fight with whispers and blades
    So get ready, a new day is dawning
    - The New Wild West -- Jewel
  • LundinLundin Member Posts: 3,711
    : You need to use GetBitmapDimensionEx() function to gain the
    : dimensions of each image file.
    :
    : [link=http://msdn2.microsoft.com/en-us/library/ms532288.aspx]GetBitma
    : pDimensionEx()[/link]
    :
    : Should contain everything you'll need to know to use it.


    Note that there are device-dependant bitmaps: that is, the "BitBlt:able HBITMAP" which you can create in runtime or load from a resource file. You can't store those directly on disk. And there are device-independant bitmaps (DIB) which can be stored to disk. So you will need to convert the device-dependant bitmaps to DIBs.

    All of this is however an advanced topic involving the Win32 API and binary files - it is not a task for a beginner programmer. You shouldn't go near the Windows API before you know C/C++ well and has been using it for a while.
Sign In or Register to comment.