GreycLab/CImg

Open PNG

Closed this issue · 2 comments

Hello. My program doesnt open .png, but open .bmp without problems.
I think i should link libpng to my Visual Studio 2015?
I downloaded libpng , add main folder path to project settings ....
and get many errors. First of them is "file "pnglibconf.h" not found".

#include <iostream>
#include <string>

#define cimg_use_png
#include "CImg.h"

using namespace std;

int main(int argc, char*  argv[])
{
    //std::string FirstArgument;
    //std::string Name0;

    //Name0 = argv[0];
    //FirstArgument = argv[1];

    //std::cout << Name0;
    //std::cout << "\n";
    //std::cout << FirstArgument;
    //std::getchar();

    string filePath = "D:\\PNG\\00005.png";

    cimg_library:: CImg<float> testImg;
    //testImg.load(filePath.c_str());
    testImg.load_png("D:\PNG\00005.png");//

    testImg.display("My Picture!");

    return 0;
}

Please, help me, i need a simple program, not spaceship-OS.
I'm crying.
VS2015

Indeed, you need to link your code with the libpng library. I've never done that in MSVC, so I can't help, but maybe someone here did. There are probably other help on the web (this is not a problem specifically related to CImg actually).

Tears.....
I'll try to use .bmp. No external files needs for this?
My After Effects CS4 doesnt supports .bmp sequnce as file output. But may be other sollution for drawing a graphic .