Reusable Code Snippet Moire patterns using circles (Tkinter, Python) If you draw a series of close spaced shapes your eyes get fooled to see Moire patterns. Here is one example of this. +2 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 Reusable Code Snippet Bersenham Circle Algorithm demonstrated using Win32 SetPixel circle.h [code] // // circle.h // defines the functions to draw circle. // #ifndef CIRCLE_H #define CIRCLE_H #include 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 Reusable Code Snippet Tkinter find the black dot illusion 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

The End.