草庐IT

c++ - 调用随机数生成成员函数不会产生完全随机数

我正在使用C++创建一个wxWidget应用程序,在程序开始时我希望应用程序窗口包含具有随机颜色的像素,如下所示:在上面的应用程序中有3600个像素(60x60),我使用uniform_int_distribution为每个像素赋予随机RGB颜色。上图中像素的颜色是在我的代码中使用以下函数生成的:voidrandom_colors(intctable[][3],intn){//constructatrivialrandomgeneratorenginefromatime-basedseed:unsignedseed=std::chrono::system_clock::now().ti