How to get image dimensions?
C / C++ / MFC
3
Posts
3
Posters
0
Views
1
Watching
-
Is there any API to get dimensions(height and width)of an image(jpg or gif)? Please help..
-
Is there any API to get dimensions(height and width)of an image(jpg or gif)? Please help..
-
Is there any API to get dimensions(height and width)of an image(jpg or gif)? Please help..
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