A
A
Alexander Shilov2018-09-04 09:49:23
C++ / C#
Alexander Shilov, 2018-09-04 09:49:23

How to add text to an image in C++?

Good afternoon. Such a task is worth it. There is a list of images, you need to pull out of them (one at a time) the date of creation of the image and place it on the image itself.
I have already found how to pull out the creation date of a file, but google cannot help me with adding this text to the image.

How do I get the modification date of a file
#include <sys/stat.h>
#include <unistd.h>
#include <time.h>

struct tm* clock;               // create a time structure
struct stat attrib;         // create a file attribute structure
stat("afile.txt", &attrib);     // get the attributes of afile.txt
clock = gmtime(&(attrib.st_mtime)); // Get the last modified time and put it into the time structure

I am attaching examples, as it is and how, approximately, it should be in case I did not express myself correctly.
original image
5b8e2acbae716959620069.jpeg
What would you like to do
5b8e2ad82aba0298015081.jpeg

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question