83. Creating verification text PNG images

This problem can be solved in a similar manner to the previous one with the national flag. If you haven’t done that one first, I recommend that you do so before continuing with this one.

There are basically three elements that the image must have:

  • A gradient-color background. This can be achieved by drawing lines (vertically or horizontally) of a different color from one side to the other of the image. Drawing lines can be done with the pngwriter::line() function. There are several overloads available; the one used in the following code takes the start and end position and three values for the red, green, and blue channels of the RGB color space.
  • A random text with letters displayed at various random ...

Get The Modern C++ Challenge now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.