In desperate need of help!
Can someone please show me how to simply display a pgm image in c++.
I have no prior experience in multimedia programming.
Thank you!

1 : use 3rd libraries, ex : openCV, CImg
2 : study the format of pgm and encode by yourself

example of openCV

#include<opencv2\core\core.hpp>
#include<opencv2\highgui\highgui.hpp>

int main()
{
  cv::Mat img = cv::imread("lena.pgm", -1);
  cv::imshow("output image", img);

  cv::waitKey();

  return 0;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.