Компьютерная графика. Лекция 2

  • Published on
    13-Feb-2016

  • View
    95

  • Download
    2

Embed Size (px)

DESCRIPTION

. 2. GDI + WPF. . 2. . API GDI, DirectDraw, Direct3D, OpenGL, GDI+ , WPF - PowerPoint PPT Presentation

Transcript

<p> : , </p> <p> . 2 GDI+ WPF1</p> <p> . 2 APIGDI, DirectDraw, Direct3D, OpenGL, GDI+, WPF </p> <p> .. Graphics Engine , </p> <p> 2</p> <p> . 2GDI, GDI+Graphics Engine 3</p> <p> . 2GDIGDI (Graphics Device Interface) API Microsoft - Windows 3.116- Windows 95/98 Windows NT/2000+ 32- , GDI+ - API, Windows XP/2003 Server- C++ 4</p> <p> . 2 GDI </p> <p> GDI Windows5</p> <p> . 2 GDI API , , BMP WMF/EMF , , GDI 6</p> <p> . 2 GDI+ - ++ Windows XP redistributable packages Windows 98/ME/NT4/2000 GDI+7</p> <p> . 2 GDI+ , GDI+ C++ GDI+ GDI </p> <p> GDI+ 8</p> <p> . 2 GDI+ GDI :</p> <p>Bitmap ;Brush ;Font ;Metafile ;Path ;Pen ;Region .9</p> <p> . 2Bitmap , , , </p> <p> :DDB device-dependent bitmapDIB device-independent bitmap</p> <p>10</p> <p> . 2Brush , GDI </p> <p>, , </p> <p> , , 11</p> <p> . 2 </p> <p> GDI+ . </p> <p>12</p> <p> . 2Font GDI+, ( ) ( , )TrueType- OpenType- ( )13</p> <p> . 2Metafile , , GDI, , bitmap</p> <p> :WMF windows metafileEMF enhanced metafile</p> <p>14</p> <p> . 2Path , / </p> <p> (, , )</p> <p>15</p> <p> . 2Pen , </p> <p> Cosmetic Geometric 16</p> <p> . 2 </p> <p>17</p> <p> . 2Region , , . , , , </p> <p>18</p> <p> . 2 (Cardinal Splines)Cardinal spline , , </p> <p>19</p> <p> . 2 (Independent Path Objects) GDI+ Graphics, GraphicsPath GraphicsPath 20</p> <p> . 2 GDI+ Matrix, , , , </p> <p> ( )</p> <p>21</p> <p> . 2 GDI+ , , </p> <p>22</p> <p> . 2 GDI+ </p> <p>23</p> <p> . 2 GraphicsGDI+ Graphics, </p> <p> , </p> <p> GDI+ Graphics24</p> <p> . 2HDC hdc;PAINTSTRUCT ps;hdc = BeginPaint(hWnd, &amp;ps);{Pen myPen(Color(255, 255, 0, 0), 3);Graphics myGraphics(hdc);myGraphics.DrawLine(&amp;myPen, 20, 10, 200, 100);}EndPaint(hWnd, &amp;ps); GDI+ 25</p> <p> . 2, , , GDI+ Graphics. Graphics, , , GDI+ , .. , - 26</p> <p> . 2 MoveTo/LineTo</p> <p> DrawRectangle FillRectangle</p> <p> GDI+ Alpha , </p> <p> 27</p> <p> . 2 GDI+ Image, Bitmap Metafile , BMPGIFJPEGPNGExifTIFFICONWMFEMF28</p> <p> . 2 Graphics Pen DrawLine Graphics :myGraphics.DrawLine(&amp;myPen, 4, 2, 12, 6); DrawRectangle GraphicsmyGraphics.DrawRectangle(&amp;myPen, 100, 50, 80, 40);Rect myRect(100, 50, 80, 50);myGraphics.DrawRectangle(&amp;myPen, myRect); 29</p> <p> . 2 </p> <p> DrawEllipsemyGraphics.DrawEllipse(&amp;myPen, 100, 50, 160, 80);Rect myRect(100, 50, 160, 80); myGraphics.DrawEllipse(&amp;myPen, myRect); 30</p> <p> . 2 </p> <p> DrawPolygonPoint myPointArray[] ={Point(0, 0), Point(50, 30), Point(30, 60)};myGraphics.DrawPolygon(&amp;myPen, myPointArray, 3); 31</p> <p> . 2</p> <p>myGraphics.SetSmoothingMode(SmoothingModeAntiAlias); myGraphics.DrawLine(&amp;myPen, 0, 0, 12, 8); 32</p> <p> . 2 GDI+ BitmapBitmap myBitmap(L"Spiral.png"); </p> <p> - , 33</p> <p> . 2 DrawImage</p> <p>:myGraphics.DrawImage(&amp;myBitmap, 10, 10); </p> <p>34</p> <p> . 2 , , </p> <p>FontFamily fontFamily(L"Arial");Font font(&amp;fontFamily, 16, FontStyleRegular, UnitPixel); 35</p> <p> . 2 DrawString GraphicsFontFamily fontFamily(L"Times New Roman");Font font(&amp;fontFamily, 24, FontStyleRegular, UnitPixel);PointF pointF(30.0f, 10.0f);SolidBrush solidBrush(Color(255, 0, 0, 255));</p> <p>graphics.DrawString(L"Hello", -1, &amp;font, pointF, &amp;solidBrush); 36</p> <p>Windows Presentation Foundation 4</p> <p> . 2Windows Presentation Foundation(WPF) Windows , () .NET Framework( 3.0), XAML.</p> <p> . 2 WPF . , . </p> <p> . 2 WPFWPF Windows Vista, Windows 7, Windows 8.WPF , XAML(Extensible Application Markup Language), , , , , , , , , , .</p> <p> . 2 WPF WPF , . , WPF, DirectX, Windows Forms, GDI/GDI+.WPF, GDI+ DirectX</p> <p> . 2 WPF Silverlight WPF .NET Framework ( , . .). , .NET, WPF. , , Silverlight. Silverlight . </p> <p> . 2 Silverlight WPF WPF ( ) . WPF . - . WPF-</p> <p> . 2 WPF , , .WPF ( System.Windows.Controls) ( ): Canvas;StackPanel; WrapPanel;DockPanel;Grid.</p> <p> . 21) Canvas () - . . 2) StackPanel . 3) WrapPanel StackPanel, . 4) DockPanel , . 5) Grid() - , , . VisualStudio ExpressionBlend Grid . , .</p> <p> . 2 </p> <p> . 2 , FrameworkElement, Height () Width () ( double), MinHeight, MaxHeight, MinWidth MaxWidth, . , XAML.</p> <p> . 2 Height Width Margin Padding . Margin , a Padding - . Margin Padding</p> <p> . 2 Margin Padding HorizontalAlignment VerticalAlignment , . , System.Windows:- HorizontalAlignment - Left, Center, Right, Stretch VerticalAlignment - Top, Center, Bottom, Stretch :</p> <p> . 2 WPF ( System.Windows.Media.Transform), . </p> <p> . 2 , System.Windows.Media:RotateTransform;ScaleTransform;SkewTransform; TranslateTransform;MatrixTransform.</p> <p>RotateTransformScaleTransform </p> <p> . 2</p> <p>SkewTransform WPF - . </p> <p> . 2 , . WPF. (, ListBoxItem ). . : ;;.</p> <p> . 2 WPF . , . Cut (), () Paste (). : WPF ; (, ); WPF . </p> <p> . 2 :- - - </p> <p> . 2 </p> <p> . 2</p> <p> WPF GDI - , WPF , , . , , , : 10x10 (0,0), - . : 10x10 (0,0) , . , . </p> <p> . 2 : Drawing, Visual Shape. Drawing - Brush . Visual Drawing , Visual , Drawing. Shape - Visual, ( ) . </p> <p> . 2 ( D-) WPF, . , 3D , XAML-. WPF , . , . </p> <p> . 2 - , , . D- - API, , : Material Light Camera </p> <p> . 2 WPF , Viewport3D, 3D- ( Camera). ( ). , WPF.</p> <p> . 2 : Light, ; Material, , - ; (Geometry) , . , WPF.</p> <p> . 2DirectionalLight ( ) , . , . PointLight ( ) . . PointLight , . </p> <p> . 2 SpotLight () - . . SpotLight , . AmbientLight ( ) . - . , .</p> <p> . 2 WPF : (, , ..). : SoundPlayer SoundPlayerAction MediaPlayer MediaElement MediaTimeline WPF MediaPlayer, MediaElement MediaTimeline. , , Windows Media Player (WMV, AVI, MPG ), WPF-. </p> <p> . 2, </p> <p> . 2 () 18 67</p> <p> . 2 </p> <p>68</p> <p> . 2 , , ( ) 69</p> <p> . 2 </p> <p> (multi-threading)GUI- 70</p> <p> . 2 , , </p> <p> 71</p> <p> . 2 1</p> <p> 72</p> <p> . 2 2</p> <p> 73</p> <p> . 2 3 </p> <p> 74</p> <p> . 2 , 75</p> <p> . 2 </p> <p> 1 2 1. 2. 76</p>

Recommended

View more >