TX Library Help – Version: 00173a, Revision: 173
 ALL  Windows graphics in a sandbox

Example03.cpp

См. документацию.
00001 //{=========================================================================== 
00011 //              $Copyright: (C) Ded (Ilya Dedinsky, http://txlib.ru) <mail@txlib.ru> $
00012 //}===========================================================================
00013 
00014 #include "TXLib.h"
00015 
00016 //----------------------------------------------------------------------------
00017 
00018 void DrawMan();
00019 void DrawEarth();
00020 void DrawFlag();
00021 void DrawHello();
00022 void DrawFrame();
00023 
00024 //----------------------------------------------------------------------------
00025 
00026 int main()
00027     {
00028     txCreateWindow (800, 600);
00029 
00030     DrawFrame();
00031     DrawEarth();
00032     DrawHello();
00033     DrawMan();
00034     DrawFlag();
00035 
00036     txTextCursor (false);
00037     return 0;
00038     }
00039 
00040 //----------------------------------------------------------------------------
00041 
00042 void DrawEarth()
00043     {
00044     txSetColor (TX_LIGHTCYAN);
00045     txEllipse (200, 150, 600, 450);
00046     txEllipse (245, 150, 555, 450);
00047     txEllipse (290, 150, 510, 450);
00048     txEllipse (330, 150, 470, 450);
00049     txEllipse (375, 150, 425, 450);
00050     txEllipse (200, 150, 600, 450);
00051     txEllipse (200, 190, 600, 410);
00052     txEllipse (200, 230, 600, 370);
00053     txEllipse (200, 270, 600, 330);
00054     txLine    (200, 300, 600, 300);
00055     }
00056 
00057 //----------------------------------------------------------------------------
00058 
00059 void DrawMan()
00060     {
00061     txSetColor (TX_YELLOW);
00062     txSetFillColor (TX_YELLOW);
00063     txLine   (385, 135, 385, 120);
00064     txLine   (385, 135, 375, 150);
00065     txLine   (385, 135, 395, 150);
00066     txLine   (385, 125, 375, 135);
00067     txLine   (385, 125, 400, 120);
00068     txCircle (385, 115, 6);
00069     }
00070 
00071 //----------------------------------------------------------------------------
00072 
00073 void DrawFlag()
00074     {
00075     txSetFillColor (TX_TRANSPARENT);
00076     txLine (400, 75, 400, 150);
00077     txRectangle (400, 75, 450, 115);
00078     txSelectFont ("Times New Roman", 20);
00079     txTextOut (425, 85, "C++");
00080     }
00081 
00082 //----------------------------------------------------------------------------
00083 
00084 void DrawHello()
00085     {
00086     txSetColor (TX_LIGHTGREEN);
00087     txSelectFont ("Times New Roman", 60);
00088     txSetTextAlign (TA_CENTER);
00089     txTextOut (400, 480, "Hello, world!");
00090     }
00091 
00092 //----------------------------------------------------------------------------
00093 
00094 void DrawFrame()
00095     {
00096     txSetColor (TX_WHITE);
00097     txSetFillColor (TX_TRANSPARENT);
00098     txRectangle (10, 10, 790, 590);
00099     }
00100 
00101 
00102 
00103 
00104