您好,欢迎光临本网站![请登录][注册会员]  
文件名称: WPF图形化编程实用手册
  所属分类: C#
  开发工具:
  文件大小: 4mb
  下载次数: 0
  上传时间: 2011-03-09
  提 供 者: tireles********
 详细说明: Contents Introduction .................................................................xix Overview.......................................................................... xix What this Book Includes.................................................. xxi Is This Book for You?...................................................... xxi What Do You Need to Use This Book?.......................... xxii How the Book Is Organized............................................ xxii Using Code Examples...................................... .............. xxiv Customer Support .......................................................... xxiv Chapter 1 Overview of WPF Programming................1 New Features in WPF ..........................................................1 XAML basics.......................................................................2 Why XAML Needed? ............................................... 2 Creating XAML Files................................................ 3 Code-Behind Files..................................................... 4 Your first WPF Program......................................................5 Properties in XAML.................................................. 6 Event Handlers in Code-Behind Files....................... 7 Code-Only Example.............................................................8 XAML-Only Example .......................................................10 Chapter 2 WPF Graphics Basics in 2D ......................13 2D Coordinate Systems in WPF ........................................13 Default Coordinates................................................. 13 Custom Coordinates ................................................ 16 Custom Coordinates for 2D Charts ......................... 22 2D Viewport .................................................. 27 Zooming and Panning.................................... 29 x | Contents Basic 2D Graphics Shapes .................................................31 Lines ........................................................................ 31 Rectangles and Ellipses........................................... 33 Polylines .................................................................. 37 Polygons .................................................................. 38 Chapter 3 2D Transformations...................................43 Basics of Matrices and Transforms....................................43 Vectors and Points................................................... 44 Scaling..................................................................... 44 Reflection ................................................................ 45 Rotation ................................................................... 46 Translation............................................................... 47 Homogeneous Coordinates ................................................47 Translation in Homogeneous Coordinates .............. 48 Scaling in Homogeneous Coordinates .................... 48 Rotation in Homogeneous Coordinates................... 49 Combining Transforms ........................................... 50 Vector and Matrix in WPF.................................................51 Vector Structure ...................................................... 51 Matrix Structure ...................................................... 53 Matrix Operations ................................................... 54 Matrix Transforms................................................... 57 Creating Perpendicular Lines .................................. 64 Object Transforms in WPF ................................................69 MatrixTransform Class ........................................... 71 ScaleTransform Class.............................................. 75 TranslateTransform Class ....................................... 79 RotateTransform Class............................................ 80 SkewTransform Class ............................................. 81 Composite Transforms ............................................ 83 Chapter 4 Geometry and 2D Drawing .......................87 Path and Geometry Classes................................................87 Line, Rectangle, and Ellipse Geometries ................ 88 GeometryGroup Class ............................................. 89 CombinedGeometry Class....................................... 92 PathGeometry Class ................................................ 96 Lines and Polylines........................................ 97 Contents | xi Arcs................................................................ 97 Bezier Curves................................................. 98 Geometry and Mini-Language .............................. 100 Interactive 2D Drawing....................................................103 Mouse Events ........................................................ 114 Creating and Combining Shapes ........................... 115 Dragging and Moving Shapes ............................... 116 Hit Testing............................................................. 117 Custom Shapes.................................................................121 Star Shape.............................................................. 121 Arrow Line ............................................................ 125 Testing Custom Shapes ......................................... 131 Chapter 5 Colors and Brushes ..................................137 Colors...............................................................................137 System Colors ....................................................... 138 Color Picker........................................................... 142 Brushes.............................................................................150 SolidColorBrush.................................................... 151 LinearGradientBrush............................................. 153 Custom Colormap Brush....................................... 158 RadialGradientBrush............................................. 165 Custom Radial Colormap Brush ........................... 169 ImageBrush ........................................................... 175 DrawingBrush ....................................................... 181 VisualBrush........................................................... 187 Bitmap Effects....................................................... 189 Opacity Masks....................................................... 194 Brush Transforms.............................................................196 LinearGradientBrush Transform ........................... 204 RadialGradientBrush Transform ........................... 206 ImageBrush Transform ......................................... 207 Drawing and Visual Brush Transform .................. 207 Chapter 6 Animation .................................................209 WPF Animation Basics....................................................209 Property-Based Animation.................................... 210 A Simple Animation in Code ................................ 211 Animation and Storyboard...............................................213 xii | Contents Storyboard and Event Trigger ............................... 213 Storyboard Animation in Code ............................. 215 Animation and Timing Behavior........................... 217 Duration ....................................................... 218 RepeatBehavior............................................ 220 AutoReverse ................................................ 220 BeginTime ................................................... 221 Speed Controls............................................. 221 Interactive Control................................................. 224 Animation and Transform................................................228 Animating Translation........................................... 228 Rolling Balls.......................................................... 231 Combining Transform Animations ....................... 236 Path Animation ................................................................240 Frame-Based Animation ..................................................244 Key-Frame Animation........................................... 244 Spline Key-Frame Animation ............................... 247 Custom Animation ...........................................................249 Custom Animation Class....................................... 250 Per-Frame Animation............................................ 254 Animation Using Timer ........................................ 256 Chapter 7 Physics and Games in WPF ....................263 Ordinary Differiential Equations .....................................263 Fourth-Order Runge-Kutta Method ...................... 264 Higher-Order ODEs .............................................. 265 ODE Solver ........................................................... 265 Pendulum .........................................................................267 Equation of Motion ............................................... 267 Pendulum Simulator.............................................. 268 Coupled-Spring System ...................................................274 Equations of Motion.............................................. 275 Coupled Spring Simulator..................................... 275 Projectiles.........................................................................287 Aerodynamic Drag Force ...................................... 287 Projectile Equations of Motion ............................. 288 Golf Game ............................................................. 289 Collision...........................................................................296 Bouncing Ball Physics .......................................... 297 Contents | xiii Bouncing Ball Simulator....................................... 299 Fractals.............................................................................306 Binary Tree............................................................ 307 Snowflake.............................................................. 310 Mandelbrot Set ...................................................... 315 Julia Set ................................................................. 323 Chapter 8 Charts in WPF..........................................331 Simple Line Charts ..........................................................331 Creating Simple Line Charts ................................. 332 How It Works ........................................................ 334 Line Charts with Data Collection ....................................334 Chart Style............................................................. 335 Data Collection...................................................... 336 Data Series............................................................. 337 Creating Charts...................................................... 339 Gridlines and Labels ........................................................342 XAML Layout....................................................... 342 ChartStyleGridlines Class ..................................... 344 Testing Project....................................................... 349 Legend..............................................................................351 Legend Class ......................................................... 352 Testing Project....................................................... 355 Chart User Control...........................................................358 Creating Chart Control .......................................... 359 Defining Dependency Properties................. 361 Chart Style for Chart Control ...................... 366 Data Collection and Data Series .................. 371 Using Chart Control .............................................. 372 Creating Simple Chart ................................. 373 Creating Multiple Charts ............................. 375 Chapter 9 3D Transformations.................................379 3D Matrices in WPF ........................................................379 3D Points and Vectors........................................... 379 Matrix3D Structure ............................................... 382 Matrix3D Operations............................................. 383 Matrix3D Transforms............................................ 387 Rotation and Quaternion ....................................... 391 xiv | Contents Projections........................................................................394 Orthographic Projections....................................... 395 Multi-View Projections ............................... 395 Axonometric Projections ............................. 396 Perspective Projections ......................................... 399 One-Point Perspective Projections .............. 400 Two-Point Perspective Projections.............. 400 Three-Point Perspective Projections............ 401 Perspective Projection Matrix...................... 401 Views and Projections in WPF ........................................402 View Transform .................................................... 403 Perspective Projection ........................................... 406 View Frustum .............................................. 406 Perspective Transform Matrix ..................... 406 Implementing Perspective Transforms ........ 409 Testing Perspective Projections................... 411 Orthographic Projection ........................................ 415 Orthographic Transform Matrix .................. 416 Implementing Orthographic Transforms ..... 417 Testing Orthographic Projections ................ 418 Object Transforms in WPF ..............................................420 ScaleTransform3D Class....................................... 421 TranslateTransform3D class ................................. 425 RotateTransform3D Class ..................................... 426 MatrixTransform3D Class..................................... 428 Combining Transforms ......................................... 429 Chapter 10 WPF Graphics Basics in 3D..................433 3D Graphics Basics..........................................................433 Viewport3D........................................................... 434 3D Objects in WPF ............................................... 435 Geometry and Mesh .............................................. 436 GeometryModel3D and Surfaces .......................... 438 Illuminating the Scene........................................... 440 Camera Position .................................................... 441 Simple Triangle in 3D ........................................... 442 Basic 3D Shapes ..............................................................444 Coordinate Axes and Wireframe........................... 445 Creating Cube........................................................ 447 Contents | xv Creating Sphere ..................................................... 453 Creating Cylinder .................................................. 456 Creating Cone........................................................ 461 Creating Torus....................................................... 464 Chapter 11 Custom 3D Geometries..........................469 Cube Geometry ................................................................469 CubeGeometry Class............................................. 469 Tesing CubeGeometry........................................... 473 Ellipsoid Geometry ..........................................................477 EllipsoidGeometry Class....................................... 477 Testing EllipsoidGeometry ................................... 480 Cylindrical Geometry.......................................................482 CylinderGeometry Class ....................................... 483 Testing CylinderGeometry.................................... 486 Cone Geometry ................................................................489 ConeGeometry Class............................................. 490 Testing ConeGeometry ......................................... 493 Torus Geometry ...............................................................497 TorusGeometry Class............................................ 497 Testing TorusGeometry......................................... 501 Icosahedron Geometry .....................................................505 IcosahedronGeometry Class.................................. 506 Testing IcosahedronGeometry .............................. 509 Dodecahedron Geometry .................................................512 DodecahedronGeometry Class.............................. 513 Testing DodecahedronGeometry........................... 519 Soccer Ball Geometry ......................................................521 SoccerGeometry Class .......................................... 522 Testing SoccerGeometry ....................................... 529 Chapter 12 Custom 3D Shapes .................................535 Deriving from UIElement3D ...........................................535 Cube Shape ......................................................................538 Cube Shape Class .................................................. 538 Testing Cube Shape............................................... 540 Ellipsoid Shape ................................................................544 Ellipsoid Shape Class ............................................ 544 Testing Ellipsoid Shape......................................... 547 xvi | Contents Cylinder Shape.................................................................548 Cylinder Shape Class ............................................ 549 Testing Cylinder Shape ......................................... 551 Cone Shape ......................................................................552 Cone Shape Class .................................................. 553 Testing Cone Shape............................................... 555 Torus Shape .....................................................................556 Torus Shape Class ................................................. 557 Testing Torus Shape.............................................. 559 Icosahedron Shape ...........................................................560 Icosahedron Shape Class....................................... 561 Testing Icosahedron Shape.................................... 563 Dodecahedron Shape .......................................................563 Dodecahedron Shape Class ................................... 563 Testing Dodecahedron Shape................................ 564 Soccer Shape....................................................................565 Soccer Shape Class................................................ 565 Testing Soccer Shape ............................................ 569 Combining Shape.............................................................569 Combining Shape Class ........................................ 570 Testing Combining Shape ..................................... 573 Chapter 13 3D Surfaces .............................................575 Simple Surfaces ...............................................................575 Rectangular Meshes .............................................. 576 SimpleSurface Class.............................................. 577 Creating Simple Surfaces ...................................... 581 Parametric Surfaces .........................................................584 ParametricSurface Class........................................ 585 Creating Parametric Surfaces ................................ 589 Helicoid Surface .......................................... 589 Sphere Surface ............................................. 590 Torus Surface............................................... 591 Quadric Surfaces.......................................... 592 Extruded Surfaces ............................................................593 ExtrudeSurface Class ............................................ 594 Creating Extruded Surfaces................................... 598 Surfaces of Revolution.....................................................599 RotateSurface Class............................................... 600 Contents | xvii Creating Surfaces of Revelution............................ 604 Surface Shading ...............................................................606 SurfaceShading Class............................................ 606 Creating Shaded Surfaces...................................... 610 Chapter 14 3D Model Manipulation ........................615 Lighting and Shading.......................................................615 Light Sources......................................................... 616 Testing Light Sources............................................ 617 Shading.................................................................. 620 Materials ..........................................................................621 Diffuse Materials................................................... 622 Specular and Emissive Materials .......................... 624 Texture Mapping..............................................................627 Using LinearGradientBrush......................... 627 Using RadialGradientBrush......................... 630 Using Image and Tile Brushes..................... 633 2D Elements on 3D Surfaces ...........................................634 Viewport2DVisual3D Class ........................ 635 Using Viewport2DVisual3D ....................... 635 Interacting with 3D Models .............................................641 Hit-Testing for 3D Geometries.................... 642 Hit-Testing for 3D Shapes ........................... 645 Rotating 3D Objects with Mouse ................ 649 Index ............................................................................653 ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: WPF 图形化编程
 输入关键字,在本站1000多万海量源码库中尽情搜索: