慢羊羊的空间

无为,无我,无欲,居下,清虚,自然

视觉错觉艺术4 铜牌收录

这是网上经常见的视觉错觉艺术图片,可以用程序生成的。效果如下:

完整的源代码如下:

///////////////////////////////////////////////////
// 程序名称:视觉错觉艺术4
// 编译环境:Visual C++ 6.0 / 2013,EasyX 20140321(beta)
// 作  者:yangw80 <yw80@qq.com>
// 最后修改:2014-7-15
//
#include <graphics.h>
#include <conio.h>


// 定义回调
void (*callback)(int x, int y);


// 画方块上的小方块
void DrawSmallBox(int x, int y, bool lt, bool rt, bool lb, bool rb)
{
	int nx = x * 26 - 13;
	int ny = y * 26 - 13;
	if
...

视觉错觉艺术3 铜牌收录

这是网上经常见的视觉错觉艺术图片,可以用程序生成的。效果如下:

完整的源代码如下:

///////////////////////////////////////////////////
// 程序名称:视觉错觉艺术3
// 编译环境:Visual C++ 6.0 / 2010,EasyX_20210730
// 作  者:yangw80 <yw80@qq.com>
// 最后修改:2014-7-14
//
#include <graphics.h>
#include <conio.h>


// 定义回调
void (*callback)(int x, int y);


// 圆中的每个点(回调函数)
void CirclePoints(int x, int y)
{
	if (x < y)
	{
		COLORREF c1 = getpixel(x, y);
		COLORREF c2 = getpixel(y, x);
		put
...

视觉错觉艺术2 铜牌收录

这是网上经常见的视觉错觉艺术图片,可以用程序生成的。效果如下:

完整的源代码如下:

///////////////////////////////////////////////////
// 程序名称:视觉错觉艺术2
// 编译环境:Visual C++ 6.0,EasyX 2013霜降版
// 作  者:yangw80 <yw80@qq.com>
// 最后修改:2013-12-16
//
#include <graphics.h>
#include <conio.h>

// 定义常量
#define	UNIT		24
#define OFFSET_X	116
#define OFFSET_Y	36

// 画装饰花
void DrawUnit(int x, int y, int shape)
{
	// 设置颜色
	int n = ((shape & 1) ? 1 : 0) + ((shape & 2) ? 1 : 0)
...

视觉错觉艺术1 铜牌收录

这是网上经常见的视觉错觉艺术图片,可以用程序生成的。效果如下:

完整的源代码如下:

///////////////////////////////////////////////////
// 程序名称:视觉错觉艺术1
// 编译环境:Visual C++ 6.0,EasyX 2013霜降版
// 作  者:yangw80 <yw80@qq.com>
// 最后修改:2013-12-16
//
#include <graphics.h>
#include <conio.h>

// 定义常量
#define	UNIT		15
#define OFFSET_X	122
#define OFFSET_Y	23

// 画每个小单元
void DrawUnit(int x, int y, int shape)
{
	// 定义颜色
	static COLORREF c[4] = {0x0000ff, 0x0077ff, 0x00ddff, 0x007
...