官术网_书友最值得收藏!

Preface

Python 2.6 Graphics Cookbook is a collection of straightforward recipes and illustrative screenshots for creating and animating graphic objects using the Python language. This book makes the process of developing graphics interesting and entertaining by working in a graphic workspace, without the burden of mastering complicated language definitions and opaque examples.

What this book covers

Chapter 1, Start your Engines: This chapter explains how to acquire and install the Python interpreter, for MS Windows or Linux as well as how to verify that Python is correctly installed. This chapter explains how to create complete working programs that can be run on client computers that do not have Python installed.

Chapter 2, Drawing Fundamental Shapes: This shows how to create all the fundamental graphic elements including lines, circles, ovals, rectangles, polygons, and complex curves. Simple examples are provided to demonstrate how to draw the elementary shapes. The examples also provide a ready for reference for later use.

Chapter 3, Handling Text: This chapter demonstrates how to control font size, color, and position using any of the font typefaces installed on the specific operating system being used. A simple means of discovering and demonstrating all available fonts on the operating system is shown.

Chapter 4, Animation Principles: This chapter starts with examples of simple sequences of a circle in different positions and systematically progresses to smoothly-moving animations of elastic balls bouncing inside a gravity field.

Chapter 5, The Magic of Color: This chapter begins with the assembling of color palettes using color names recognizable to Python. The way colors are constructed using numbers to mix controlled amounts of red, green, and blue is explained. Tools for matching colors to any sample are constructed. This chapter demonstrates how to vary shadings of one color into another.

Chapter 6, Working with Pictures: This chapter reveals how to acquire and use the Python Imaging Library to manipulate photo images. It also shows methods of image format conversion, re-sizing, rotating, color transforming, and complex filtering.

Chapter 7, Combining Vector and Raster Images: This chapter demonstrates the ways of combining animated vector graphics with photographic images to produce complex animations.

Chapter 8, Data in and Data Out: This chapter starts with basic storing and retrieving of files to a hard drive and progresses to the construction of programs that are tools for creating, storing, and retrieving free-form shapes drawn using a mouse.

Chapter 9, Exchanging Inkscape SVG Drawings with Tkinter Shapes: This chapter shows in detail how to use the Inkscape drawing tool to convert shapes traced from a photographic image into a sequence of points which reproduce the shape in Python. Once a line is expressed as a Python sequence, it can be transformed numerically in many ways.

Chapter 10, GUI Construction: Part 1: This chapter provides basic examples of how to create buttons, data entry boxes, drop-down menus, list-boxes, and text labels. It also covers how to customize button appearance.

Chapter 11, GUI Construction: Part 2: Here the Grid Layout Manager and the Pack Layout Manager are explained and demonstrated. Examples of radio buttons, check buttons, scrollbars, frames, and keystroke event coding are given. It also shows how to construct widgets using graphic elements on a canvas.

Appendix, Quick tips for running Python programs in Microsoft Windows: This gives explanations of how to overcome some of the difficulties a new python programmer might encounter when trying to use Python in Windows.

主站蜘蛛池模板: 榕江县| 资中县| 镇远县| 和林格尔县| 绍兴市| 石景山区| 甘洛县| 杭锦后旗| 丰县| 北流市| 延安市| 竹溪县| 年辖:市辖区| 永修县| 贵州省| 潼关县| 桃园市| 炉霍县| 巍山| 漾濞| 太保市| 镇雄县| 阳东县| 宝应县| 昌都县| 荔浦县| 利辛县| 斗六市| 常宁市| 盐亭县| 吴堡县| 怀宁县| 延长县| 和田市| 寿阳县| 祁东县| 平昌县| 斗六市| 喀什市| 汤阴县| 郴州市|