Visual Basic graphics programming : hands-on applications and advanced color development
Author(s)
Bibliographic Information
Visual Basic graphics programming : hands-on applications and advanced color development
John Wiley, c2000
2nd ed
- : pbk
Available at 9 libraries
  Aomori
  Iwate
  Miyagi
  Akita
  Yamagata
  Fukushima
  Ibaraki
  Tochigi
  Gunma
  Saitama
  Chiba
  Tokyo
  Kanagawa
  Niigata
  Toyama
  Ishikawa
  Fukui
  Yamanashi
  Nagano
  Gifu
  Shizuoka
  Aichi
  Mie
  Shiga
  Kyoto
  Osaka
  Hyogo
  Nara
  Wakayama
  Tottori
  Shimane
  Okayama
  Hiroshima
  Yamaguchi
  Tokushima
  Kagawa
  Ehime
  Kochi
  Fukuoka
  Saga
  Nagasaki
  Kumamoto
  Oita
  Miyazaki
  Kagoshima
  Okinawa
  Korea
  China
  Thailand
  United Kingdom
  Germany
  Switzerland
  France
  Belgium
  Netherlands
  Sweden
  Norway
  United States of America
Note
"Wiley Computer Publishing."
Includes index
1 CD-ROM in pocket (12 cm)
Description and Table of Contents
Description
All the tools you need to create the full range of Visual Basic(r) color graphics applications
Expert Rod Stephens provides you with everything you need to add advanced graphics to your applications in this in-depth introduction to graphic programming with Microsoft Visual Basic. From images using as few as 16 colors to "true-color" applications that use more than 16 million, he shows you how to create the full range of color graphics applications. You'll learn how to use Visual Basic controls to create impressive graphic effects without having to buy expensive add-on products.
This book/CD-ROM package also explains how to integrate imaging, animation, and two- and three-dimensional graphics into an application. And you'll find the tools to manipulate color images, overlay one image on another, build scrolled windows, and much more.
The Second Edition covers:
* New API functions
* Bitmap image morphing
* New algorithms for hidden surface removal
* Print preview with multiple pages and scales
* Image processing, including high color and true color
* Examples of controlling animation using simulation
* New examples that demonstrate shape-distorting transformations
* New examples of fractals and tilings
* Gouraud shading, Phong shading, and texturing
* Ray tracing speed improvements
* Ray tracing for new kinds of objects
The CD-ROM includes:
* More than 400 complete, ready-to-run example programs
* Pictures to use with the example programs
* Images generated by the programs
* Color images of many of the figures from the book
* Source code for all example programs from the First Edition
Table of Contents
Introduction
Part One: Working with Windows 1
Chapter 1 Visual Basics 3
Visual Basic Coordinate Systems 3
Custom Coordinates 5
Coordinate Overflow 8
Scale Conversions 8
Size and Positioning 9
Interior Sizing 10
The Move Method 13
Graphic Container Controls 13
Line Method 14
Circle Method 15
PaintPicture Method 20
PSet Method 22
Point Method 24
Print Method 25
Scrolled Windows 27
Scrolled Window Controls 30
When to Draw 30
AutoRedraw Property 31
Paint Events 31
Redrawing During Resize Events 31
Controlling Controls 34
Text Properties 35
Other Graphic Properties 38
Graphical Controls 47
Image Control 47
Label Control 48
Line Control 48
Shape Control 49
Color 49
RGB Colors 50
System Colors 50
Decomposing Colors 52
QBColor 53
Summary 54
Chapter 2 Using the API 55
The Genie 55
Using the API 56
Identifying the Routine 56
Defining Data Structures 56
Declaring the Routine 58
Calling the Routine 63
Useful API Functions 65
Drawing 65
Drawing Attributes 72
Metafiles 78
Summary 80
Chapter 3 Advanced Color 81
Color Models 81
Bitmaps 84
Device-Dependent Bitmaps 84
Device-Independent Bitmaps 89
Color Palettes 91
Static Colors 94
Inverting Static Colors 94
Colors in Visual Basic 96
Summary 111
Chapter 4 Advanced Text 113
Multiple Colors and Fonts 114
Text Metrics 117
CreateFont Function 119
Height 120
Width 120
Escapement 120
Orientation 121
Weight 121
Italic, Underline, StrikeOut 122
CharacterSet 122
OutputPrecision 123
ClipPrecision 123
Quality 124
PitchAndFamily 124
Face 125
Standard Fonts 125
Programming with CreateFont 126
Curved Text 127
Centering Rotated Text 131
Editable Text 134
Summary 139
Chapter 5 Printing 141
Printer Objects 141
Selecting a Printer 142
Printer Properties 144
Printer Control Methods 146
The PrintForm Method 146
High-Resolution Printing 147
Printing Text 148
Print Preview 150
Multipage Print Preview 152
Printer Scale Properties 156
Scaling Objects to Fit 158
High Resolution PrintForm 160
Summary 162
Part Two: Image Processing 163
Chapter 6 Point Processes 165
Obtaining Images 165
Programming Tools 166
LoadPicture 166
LoadImage 167
SavePicture Routine 169
Point and PSet Functions 170
Point Processes 171
Grayscale 171
Complement 173
Brightness 174
Color Balance 175
Contrast 176
Binary Contrast Enhancement 182
Multiple Image Processing 185
Image Subtraction 186
Image Averaging 187
Image Compositing 188
Summary 190
Chapter 7 Area Processes 191
Spatial Filtering 191
Initializing Kernels 195
Low-Pass Filters 196
Unsharp Masking 197
High-Pass Filters 197
Edge Detection 200
Embossing 202
Restricting an Operation Using a Mask 202
Summary of Spatial Filters 203
Rank Filters 203
Geometric Transformations 204
Bilinear Interpolation 205
A Transformation Framework 207
Enlargement 209
Reduction 211
Cheating with LoadImage 213
Rotation 215
Reflection 218
Complex Reflection 219
Shape-Distorting Transformation 221
Summary 222
Part Three: Animation 223
Chapter 8 Bitmap Animation 225
Animation Basics 225
Timing Is Everything 226
Timing in Visual Basic 227
Fast Display 227
Timer Controls 228
Clock Watching 230
Displaying Files Directly 231
Storing Image Bits 232
The Need for Speed 235
Drawing Animation 236
Clear and Redraw 237
Save and Restore 241
Using the API 243
Summary 244
Chapter 9 Advanced Animation 245
Controlling Animation 245
Simulation 245
Scripts 248
Sprites 250
Tweening and Morphing 253
Tweening 254
Morphing 259
Specialized Animation 262
Scene Transitions 263
Screen Savers 271
Animating Program Icons 276
Summary 277
Part Four: Two-Dimensional Graphics 279
Chapter 10 Fractals and Tilings 281
Fractals 281
Trees 282
Snowflakes 288
Space-Filling Curves 296
Gaskets 302
The Mandelbrot Set 308
Julia Sets 313
Strange Attractors 316
Tilings 318
Summary 321
Chapter 11 Drawing Curves 323
Lines and Circles 323
Parametric Curves 324
DrawCurve 325
Rotating Points 327
Curve Fitting 330
Polynomial Curve Fitting 331
Linear Least Squares 331
Quadratic Least Squares 334
Higher-Order Least Squares 336
Parametric Curve Fitting 344
Hermite Curves 344
Bezier Curves 348
Higher-Order Bezier Curves 351
B-Splines 353
Closed B-Splines 358
Summary 361
Chapter 12 Two-Dimensional Transformations 363
Modeling Two-Dimensional Objects 363
Windows and Viewports 369
Panning and Zooming 369
Aspect Ratios 371
Windows and Viewports in Visual Basic 375
Zooming and Panning in Visual Basic 377
Two-Dimensional Transformations 384
Simple Transformations 385
Combining Transformations 388
Transformation Matrices in Visual Basic 395
Vector and Matrix Operations in Visual Basic 401
Transforming Objects 403
Shape-Distorting Transformations 404
Treating Types of Transformation Differently 407
Display Data Structure 408
Quadtrees 409
Locating Objects 409
Quadtrees in Visual Basic 410
A Quadtree Implementation 411
Summary 416
Part Five: Three-Dimensional Graphics 417
Chapter 13 Three-Dimensional Transformations 419
Simple Transformations 419
Homogeneous Coordinates 420
Vector and Matrix Operations in Visual Basic 420
Translation 422
Scaling 423
Reflection 424
Right-Handed Coordinates 425
Rotation 426
Inverse Transformations 429
Projections 429
Parallel Projection 430
Perspective Projection 438
Summary of Projections 442
Perspective Viewing 442
Composing Transformations 446
Scaling without Translation 446
Reflection across an Arbitrary Plane 447
Rotation around an Arbitrary Line 452
Projection onto an Arbitrary Plane 454
The UP Vector 455
Using Subroutine m3Project 456
Spherical Coordinates 459
Three-Dimensional Objects 461
Summary 464
Chapter 14 Surfaces 465
Simple Surfaces 465
Grids 466
The Hi-Lo Algorithm 481
The Z-Order Algorithm 490
Fractal Surfaces 492
Parametric Surfaces 498
Bezier Surfaces 499
B-Splines 506
Surfaces of Transformation 514
Extruded Surfaces 514
Surfaces of Revolution 520
Other Surfaces of Transformation 524
Summary 530
Chapter 15 Hidden Surface Removal 531
Backface Removal 531
Finding Surface Normals 532
Testing Angles with Normals 533
Putting It All Together 534
Convex Solids 534
Backface Removal in Visual Basic 535
Depth-Sort 539
Nonconvex Solids 541
Surfaces Revisited 554
Summary 559
Chapter 16 Shading Models 561
The Physics of Lighting 561
Diffuse Reflection 562
Ambient Light 566
Distance 567
Specular Reflection 570
Smooth Shading 576
Gouraud Shading 576
Phong Shading 581
Summary 583
Chapter 17 Ray Tracing 585
A Brief Warning 587
Ray-Tracing Basics 587
Ray Tracing in Visual Basic 589
Calculating Hit Color 592
Tracing Rays 593
Performance 597
Bounding Volumes 598
Scanline Culling 599
Other Objects 601
Planes 601
Disks 605
Polygons 608
Checkerboards 611
Cylinders 614
Recursive Ray Tracing 622
Reflected Light 623
Transparent Surfaces 625
Assumptions 634
Adaptive Depth Control 636
Texture Mapping 637
Normal Perturbation 637
Environment Mapping 638
Special Environment Mapping 639
Summary 641
Part Six Beyond Three Dimensions 643
Chapter 18 Higher-Dimensional Transformations 645
Temporal Projection 645
Spatial Projection 647
Four-Dimensional Transformations 647
Homogeneous Coordinates 648
Translation 648
Scaling 649
Reflection 649
Rotation 650
Inverse Transformations 651
Projections 651
Rotating a Hypercube 656
Folding a Hypercube 656
Summary 661
Chapter 19 Mathematical Tools 663
Vectors and Matrices 663
Vector Arithmetic 664
Vector Length 665
Dot Product 665
Projection of a Vector onto a Vector 666
Cross Product 667
Matrix-Vector Multiplication 668
Matrix-Matrix Multiplication 669
Transformation Matrices 670
Two-Dimensional Transformations 670
Three-Dimensional Transformations 670
Four-Dimensional Transformations 673
Spherical Coordinates 674
Distances 675
Point-to-Point 675
Point-to-Line 675
Point-to-Plane 676
Line-to-Line 677
Plane-to-Plane 677
Platonic Solids 678
Regular Solids 679
Duals 679
Tetrahedron 680
Cube 683
Octahedron 684
Dodecahedron 684
Icosahedron 689
Summary 692
Index 693
by "Nielsen BookData"