ebook img

Power Graphics Using Turbo Pascal PDF

388 Pages·1989·4.98 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Power Graphics Using Turbo Pascal

Digitbiytz heIedn ternet Archive in2 010 htpt/:w/wwa.crhei.vgod/retails/powergraphicsusi00weis Power Graphics Using Turbo Pascal® Related Titles of Interest Turbo Language Essentials: A Programmer's Reference, Weiskamp, Shammas, and Pronk Turbo Libraries: A Programmer's Reference, Weiskamp, Shammas, and Pronk Turbo Algorithms: A Programmer's Reference, Weiskamp, Shammas, and Pronk Introducing C to Pascal Programmer's, Shammas Advanced Turbo C Programmer's Guide, Mosich, Shammas, and Flamig The Turbo C Survival Guide, Miller and Quilici C Programming Language: An Applied Perspective, Miller and Quilici C Wizard's Programming Reference, Schwaderer Turbo C DOS Utilities, Alonso Quick C DOS Utilities, Alonso Turbo C and Quick C Functions: Building Blocks for Efficient Code, Barden Power Graphics Using Turbo C, Weiskamp, Heiny, and Shammas Applying Turbo Pascal Library Units, Shammas Programming with Macintosh Turbo Pascal, Swan Turbo Pascal DOS Utilities, Alonso Artificial Intelligence Programming with Turbo Prolog, Weiskamp and Hengl Mastering HyperTalk, Weiskamp and Shammas Power Graphics Using Turbo Pascal® Keith Weiskamp Loren Heiny Namir Shammas a WILEY John Wiley & Sons, Inc. New Yorl •Chichester• Brisbane• Toronto• SingaporL' Publisher: Stephen Kippur Editor: Katherine Schowalter Managing Editor: Ruth Greif Compositor: Loren Heiny Turbo C, Turbo Pascal, and Quattro are registered trademarks of Borland International, Inc. This publication is designed to provide accurate and authoritative information in regard to the subject matter covered. It is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional service. If legal advice or other expert assistance is required, the services of a competent professional person should be sought. FROM A DECLARATION OF PRINCIPLES JOINTLY ADOPTED BY A COMMITTEE OF THE AMERICAN BAR ASSOCIATION AND A COMMITTEE OF PUBLISHERS. Copyright© 1989 by John Wiley & Sons, Inc. All rights reserved. Published simultaneously in Canada. Reproduction or translation of any part of this work beyond that permitted by section 107 or 108 of the 1976 United States Copyright Act without the permission of the copyright owner is unlawful. Requests for permission or further information should be addressed to the Permission Department, John Wiley & Sons, Inc. Library of Congress Cataloging-in-Publication Data Weiskamp, Keith. Power graphics using Turbo Pascal/ Keith Weiskamp, Loren Heiny, Namir Shammas. p. cm. Bibliography: p. ISBN 0-471-61841-1 1. Computer graphics. 2. Turbo Pascal (Computer program) I. Heiny, Loren. I I. Shammas, Namir Clement, 1954- . III. Title. T385.W46 1989 006.6'869--dc 19 89-30964 CIP Printed in the United States of America 89 90 10 9 8 7 6 5 4 3 tlf.4�r·< '. ��� '�- .. � '· . • .. ,'...,•: ·." Contents Preface xi Chapt1e rT heB GIQ uicTko ur 1 GettSitnagr t2e d InititahlBeiG zIi2 n g WrittihnBega sBiGcIP rogr3a m ErrCohre cki4n g WorkwiintgCh o ordin6a tes DrawCionmgm ands 7 GettDionwgtn oP ixe7l s DrawFiinggu r1e sO FilFliignugr 1e3s Texatn dF ont1s6 FracLtaanld sca1p8e s Chapt2e rT heB GID rawiFnugn ctions 25 WorkwiintgPh i xe2l5s Plotat iSnigPn igxlee2l 6 GeneDrraalw Cionmgm and2s6 DrawLiinnge 2s6 DrawiLninge sA bwsiotlChu otoer din2a7t es DrawLiinngwe istR he laCtoiovred in2a8t es SettaiL nign e S2t8y le PredefLiinnPeead t te2r9n s V vi ..llll Power Graphics Using Turbo Pascal Determining the Current Line Style 30 User-Defined Line Styles 31 Drawing Rectangles 31 Working with Polygons 32 Arcs, Circles, and Ellipses 33 Drawing Arcs 34 Arc Endpoints 34 Circles and Ellipses 35 Fundamentals of Animation 36 Filling Regions 39 Setting the Fill Pattern 42 User-Defined Fill Patterns 42 Getting the Fill Pattern 43 Experimenting with User-Defined Fill Patterns 44 Using the Arrow Keys 44 Working with Flood-Fills 51 Chapter 3 The BGI Fonts and Text 53 Text in Graphics Mode 53 The Bit-Mapped Font 54 The Four Stroke Fonts 54 The BGI Text Functions 55 Writing Text to the Screen 56 Writing Text to a Pixel Location 57 An Example of Text Display 57 How Turbo C Accesses Fonts 58 Selecting and Loading a Font 59 Errors in Loading a Font 60 Working with Text Justification 61 Determining the Current Text Settings 62 Determining the Character Dimensions 64 A Note about Vertical Character Dimensions 65 Magnifying Characters 65 Fitting Text Inside a Box 67 A Note on Clipping Text 71 Displaying Characters and Numbers 71 Extended Text Manipulation Routines 71 Graphics Version of write 72 Working with Text Input 74 Entering Numeric Values 75 Contents ..& vii Chapter 4 Presentation Graphics 81 The Basic Graph Types 81 Getting Started 82 Pie Charts 82 Drawing a Slice 82 Labeling Pie Slices 84 Making Each Slice Different 86 Creating a Legend 86 Emphasizing a Slice 90 Creating Bar Graphs 93 Three-Dimensional Bar Graphs 100 Coin Graphs 101 Animated Graphs 103 Chapter 5 Graphics Techniques In Two Dimensions 107 Screen Coordinates 107 Working with Aspect Ratios 108 Screen and World Coordinates 109 Mapping between Coordinate Systems 109 Transformations 112 Translation 112 Scaling a Two-Dimensional Polygon 114 Rotating a Two-Dimensional Polygon 116 The Shear Transform 118 A Matrix Demo 125 Object Oriented Programming 126 Working with OOP 127 An Object-Oriented Utility 127 The Internal Object List 127 Adding an Object 129 Selecting an Object 130 Chapter 6 Animation 135 A Closer Look at lnbetweening 135 Animating a Line 136 Working with lnbetweening 137 Working with Getlmage and Putlmage 140 Animating Objects On a Backdrop 146 Animating Multiple Objects 151 Limitations of Getlmage and Putlmage 151 viii ..t Power Graphics Using Turbo Pascal Animating Using the Palette 151 Using Multiple Screen Pages 157 Chapter 7 Creating Mouse Tools 159 Starting with the Mouse 159 Mouse Overview 160 Accessing the Mouse Driver 160 The Mouse Functions 162 Mouse Initialization 162 More Mouse Routines 165 The Mouse Cursor 165 The Default Mouse Cursor 166 Mouse Position 167 Mouse Buttons 168 Mouse in a Box 170 More Mouse Control 171 Adding Keyboard Input 172 Emulating a Mouse 172 The Emulated Mouse Cursor 173 Emulated Mouse Position 17 4 Emulated Mouse Buttons 17 4 Putting Your Mouse to the Test 189 Chapter 8 Working with Icons 191 Why Icons? 191 Representing Icons 192 Saving Icons 193 Reading an Icon File 194 The Interactive Editor 195 Creating the Screen 196 Creating an Enlarged Icon 197 Displaying the Original Icon 199 Interacting with the User 199 Toggling an Icon Pixel 200 Exiting the Icon Editor 201 Sample Icons 203 Chapter 9 Pop-up Windows in Graphics 211 The Basic Approach 211 Working with a Stack 213 Initializing the Windows Package 215

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.