Лекция 5. C++ Builder: работа с графикой и мультимедиа
-
Upload
stanislav-katsko -
Category
Education
-
view
8.013 -
download
15
description
Transcript of Лекция 5. C++ Builder: работа с графикой и мультимедиа
- 1.
- Borland C++ Builder:
Attribution-ShareAlike (by-sa) stanislav.katsko.name Informatics.ssga.ru 2. 1. 3. , . :
- ;
4. ( Tcanvas)
5. Canvas( ). ( ) , , , . , , .
6. , , . WM_PAINT . OnPaint .
7. 1. OnPaint( Events ). 2. . 3. .
8. 2. 9. (Canvas ), TPaintBox System . TPaintBox OnPaint .
10. : ( Pen, TPen) ( Brush, TBrush) ( Font, TFont) void __fastcall TForm1::PaintBox1Paint (TObject*Sender) { PaintBox1->Canvas->Pen->Color = clGreen; PaintBox1->Canvas->Pen->Width = 3; PaintBox1->Canvas->Brush->Color = clRed; }
11. void __fastcall TForm1::PaintBox1Paint (TObject*Sender) { TRect tc; PaintBox1->Canvas->Pen->Color = clGreen; PaintBox1->Canvas->Pen->Width = 3; PaintBox1->Canvas->Brush->Color = clRed; rc.Left = 5; rc.Right = 100; rc.Top = 0; rc.Bottom = 50; PaintBox1->Canvas->Rectangle(rc); }
12. TextOut() PaintBox1->Canvas->TextOut (20,30,"!"); Font. PaintBox1->Canvas->Font->Color = clBlue; PaintBox1->Canvas->Font->Size = 14;
13. TBitmap( Graphics) (*.bmp). TImage Additional . Picture , TPicture. AutoSize .
14. 3. 15. (), . : 1. . 2. . 3. .
16. , . , .
17. , . - .
18. fon.bmp( ) () kolobok.bmp , . : () .
19. 1.1. . 1.2. . 1.3. b1 b2 ( TBitmap) . 1.4. . 1.5. ( TBitmap), b1 b2. LoadFromFile.
- 1.
20. 2.1. OnPaint ( Events OnPaint . 2.2. Draw().
- 2.
21. 3.1. . 5050. . . CopyMode cmSrcCopy b1.
- 3.
22. 3.2. TRect ( b2, ) .
- 3.
23. 3.3. TForm1 MaskBitmap . 3.4. b2. TBitmap b2. Assign() .
- 3.
24. 3.5. . Mask(). , . , .
- 3.
25. 3.6. FormPaint() . And. CopyMode.
- 3.
26. 3.7. . CopyRect() . , , .
- 3.
27. 3.8. . 3.9. () . , . .
- 3.
28. 4.1. . 4.2. Interval 500 . 4.3. TTimer . 4.4. . KolF, , . .
- 4.
29. 4.5. OnPaint ( ) KolF. 4.6. .
- 4.
30. 4. 31. (TMediaPlayer) System . , Windows Media Player, .
- -
32. , , Play(). ( Wait). MediaPlayer1->FileName = "song.mp3"; MediaPlayer1->Wait = false; MediaPlayer1->Play(); x=1; // .
- -