Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to get image dimensions?

How to get image dimensions?

Scheduled Pinned Locked Moved C / C++ / MFC
jsonhelptutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Monisankar
    wrote on last edited by
    #1

    Is there any API to get dimensions(height and width)of an image(jpg or gif)? Please help..

    S V 2 Replies Last reply
    0
    • M Monisankar

      Is there any API to get dimensions(height and width)of an image(jpg or gif)? Please help..

      S Offline
      S Offline
      Selvam R
      wrote on last edited by
      #2

      Hi, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_0rho.asp[^] Regards, Selvam

      1 Reply Last reply
      0
      • M Monisankar

        Is there any API to get dimensions(height and width)of an image(jpg or gif)? Please help..

        V Offline
        V Offline
        viliam
        wrote on last edited by
        #3

        With GDI+ it could be like this: #include #include #include using namespace Gdiplus; INT main() { GdiplusStartupInput gdiplusStartupInput; ULONG_PTR gdiplusToken; GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); Image* image = new Image(L"Crayons.jpg"); UINT imageHeight = image->GetHeight(); printf("The height of the image is %u.\n", imageHeight); delete image; GdiplusShutdown(gdiplusToken); return 0; } viliam

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups