Examples

For more sample programs, visit https://codebus.cn.

Character Array

The program demonstrates common drawing operations, including setting fonts, drawing lines, and so on.

cpp source file    exe file

Stars

The program achieves the dynamic effect of two-dimensional starry sky.

cpp source file    exe file

Mouse operations

The program demonstrates the common mouse operation, the program will be executed on the mouse movement trajectory to draw a red dot, press the left button to draw small squares, press Ctrl and left key to draw a large square, press the right click to exit the program.

cpp source file    exe file

Rainbow

The program is an example of an application for the HSL color model, which adjusts the brightness of the HSL model to draw a gradient of the sky and adjusts the hue to draw a seven-color rainbow.

cpp source file    exe file