lundi 1 juillet 2019

Creating a background with RGB value 73,95,105 in CImg[C++]

Trying to create a background with the above RGB values,however the only success i had till now is by loading jpegs.Is there a way to create the background programmatically?

#include "CImg.h"

using namespace cimg_library;

constexpr int Height = 600;
constexpr int Width = 539;

int main() {
    CImgDisplay mainWindow(Height,Width);
    CImg<unsigned char> background;  
    // background. ??? Is there a function to do so or loading a jpeg the only way
    while(!mainWindow.is_closed()) {
        mainWindow.display(background);
    }

    return EXIT_SUCCESS;
}

Aucun commentaire:

Enregistrer un commentaire