Member Avatar

If you draw a series of close spaced shapes your eyes get fooled to see Moire patterns. Here is one example of this.

+2 forum 0
Member Avatar
Reusable Code Snippet Save a PyGame drawing

You can draw a number of shapes directly on the PyGame window, and then save the drawing to an image file.

+3 forum 0
Member Avatar

circle.h [code] // // circle.h // defines the functions to draw circle. // #ifndef CIRCLE_H #define CIRCLE_H #include <windows.h> typedef struct tagCircle { int x; int y; int radius; } Circle; /* set the window handle */ void SetWindowHandle(HWND); /* set pixel @parms int x xposition @parms int y yposition @parms Color color of the pixel. @returns void */ void Circle_SetPixel(int,int,COLORREF&); /* circle dawing function @parms int x x position of the circle to be drawn @parms int y center y position. @parms int radius radius of the circle. */ void DrawCircle(int,int,int); #endif // END CIRCLE_H [/code] circle.cpp [code] #include …

+2 forum 0
Member Avatar

Python programming can have its lighter moments. Here we use one of those moments to draw an optical illusion using the Tkinter canvas to draw a rectangle, some lines and circles.

+2 forum 0

The End.