Easyxの基礎知識


コントロールページクラス:
1.#include <graphics.h>   // Easyx     

2.initgraph(x,y);   //   x*y       

3.closegraph();   //      

4.Sleep(n);   //  n  

5.System("pause");   //     ,          

6.initgraph(x,y,SHOWCONSOLE);   //   x*y             

7.setorigin();   //      

値クラスの取得:
1.char c;
        if(kbhit())       //         
            c=getch();      // getch()    

2.SYSTEMTIME STRUCT
  {
        WORD wYear;
        ...
  }SYSTEMTIME ENDS    //          
  /* :*/SYSTEMTIME t;    //         
         GetLocal Time(&t);    //      
         t.wHour;t.wMinute;t.Second;    //    

3.struct MOUSEMSG
   {
        UINT uMsg;      //       
        bool mkCtrl;    // Ctrl      
        bool mkShift;   // Shift      
        bool mkLButton; //         
        bool mkMButton; //         
        bool mkRButton; //         
        int x;          //      x   (    )
        int y;          //      y   (    )
        int wheel;      //        
  };
  /*              :*/
	WM_MOUSEMOVE    //      
	WM_MOUSEWHEEL   //         
	WM_LBUTTONDOWN  //      
	WM_LBUTTONUP    //       
	WM_LBUTTONDBLCLK//       
	WM_MBUTTONDOWN  //       
	WM_MBUTTONUP    //       
	WM_MBUTTONDBLCLK//       
	WM_RBUTTONDOWN  //       
	WM_RBUTTONUP    //      
	WM_RBUTTONDBLCLK//      
   /* :*/MOUSEMSG m;
		   m=Get.MouseMsg();
           if(m.uMsg==WM_LBUTTONDOWN);    //              

4.getbacolor();   //        

5.if(GetAsyncKeyState(VK_RIGHT)&0x8000)   //          ,VK_LEFT,VK_UP,VK_DOWN     , , 

サイズスタイルクラスを設定するには、次の手順に従います.
1.setcolor(c);    //       c

2.setfillcolor(c);    //       c

3.settextcolor(RED);   //         

4.settextstyle(36,15,"  ");   //36   ,15     

5.setbkmode(TRANSPARENT);   //        

6./*        */HSLTORGB(0-360,0-1,0-1);   //           (       ),   ,  

7.setlinestyle(int linestyle,unsigned patten, ine width)   //              
  /*linestyle    ,          ,      :*/
	0 SOLID_LINE  //   
	1 DOTTED_LINE  //  
	2 CENTER_LINE  //   
	3 DASHED_LINE  //   
	4 USERBIT_LINE  //      
  /*patten USERBIT_LINE    ,      :*/
	PS_SOLID  //  
	PS_DATA  //  
	PS_DOT  //  
	PS_DASHDOT   //   
	PS_DASHDOTDOT  //    
  /*width     */
  /* :*/setlinestyle(PS_SOLID,2,NULL);   //   2   ,      NULL,   
          setlinestyle(PS_SOLID,10);    //   10    
		  setlinestyle(PS_SOLID,10);    //   10    

8.LOGFONT f;      //      
  getfont(&f);
  f.lfHeight=42;   //   42
  strcpy(f.lfFaceName,"  ");   //     
  setfont(&f);

線分パターンクラスを描画するには:
1.line(x1,y1,x2,y2);   //    (x1,y1)  (x2,y2)   

2.circle(x,y,r);   //    (x,y)       r  

3.putpixel(x,y,c);   //(x,y)      ,   c。c         

4.fillcircle(x,y,r);   //    (x,y)       r    

5.bar(left,top,right,bottom);   //       ,(left,top)        ,(right,bottom)      ,     setfillstyle  

6.rectangle(left,top,right,bottom);   //       ,(left,top)        ,(right,bottom)      ,     setcolor  

7.fillellipse(x,y,xradius,yradius);   //    (x,y)        ,x   x-xradius,y   y-yradius

8.SetWorkingImage(&img);   //,IMAGE    img  , img       

クラスを表示:
1.outtextxy(x,y,char *textstring);   //  (x,y)     *textstring
  /* :*/outtextxy(200,100,_T("hello"));
          outtextxy(100,100,"  ");

2.rand()%10;    //     ,     10
  rand()%6+1;   //   1-6
  /*    rand()          ,            ,              ,        srand((unsigned)time(NULL));*/

3.IMAGE img;     //  image  
  loadimage(&img,"c:\\test.jpg");    //     img  
  putimage(0,0,&img);   // (0,0)     
  /*  loadimage(NULL,"image/...");         ,      */

4.IMAGE img;     //  image  
  getimage(&img,70,70,130,130);    //      (70,70), 130, 130           img ,       

5.IMAGE img(200,200);   //  200*200 img  

5.HWND hwnd=GetHwnd();   //        
  SetWindowText(hwnd,"hello world!");    //      

6.setbkcolor(RED);   //        
  cleardevice();   //    ,        

7./*    ,   ,                ,     EndBatchDraw      */
   BeginBatchDraw();   //      
   for(int i=0;i<n;i++)
   {
		FlushBatchDraw();   //  
		Sleep(10);
   }
   EndBatchDraw();   //      

8./*      */
  /*     :*/#pragma comment(lib,"Winmm.lib");
  /*       :*/mciSendString("open audio/move.mp3 alias move",NULL,0,NULL);   // audio     move.mp3        move
                      mciSendString("play move from 0",NULL,0,NULL);          // move    
					  mciSendString("play move repeat",NULL,0,NULL);          // move    
					  mciSendString("stop move",NULL,0,NULL);                 // move    
					  mciSendString("play move",NULL,0,NULL);                 // move              

9./*    (    )*/
  putimage(x,y,&img1,SRCAND);   //    
  putimage(x,y,&img2,SRCRAINT);   //    
  // SRCAND           , SRCRAINT          ,         (    )   ,