{"rsdb":{"rid":"152268","subhead":"","postdate":"0","aid":"114580","fid":"55","uid":"1","topic":"1","content":"
\n

1www.easyx.cn \u4e0b\u8f7d<\/a> EasyX \u5e93<\/strong><\/p> \n

\u6211\u4e0b\u76842014;\u89e3\u538b\u540e\u5982\u4e0b\u56fe\uff1b<\/p> \n

\"\\\"<\/p> \n

2 \u6839\u636e\u81ea\u5df1\u7684VC \u7248\u672c\u8fdb\u884c\u5b89\u88c5<\/strong><\/p> \n

\"\\\"<\/p> \n

3 \u5728\u63a7\u5236\u53f0\u753b\u4e00\u4e2a\u5706<\/strong><\/p> \n

<\/p> \n

\r\n#include \n  \n    \/\/ \u5f15\u7528\u56fe\u5f62\u5e93\r\n#include \n   \n     void main() { initgraph(640, 480); \/\/ \u521d\u59cb\u5316\u7ed8\u56fe\u7a97\u53e3 circle(200, 200, 100); \/\/ \u753b\u5706\uff0c\u5706\u5fc3(200, 200)\uff0c\u534a\u5f84 100 getch(); \/\/ \u6309\u4efb\u610f\u952e\u7ee7\u7eed closegraph(); \/\/ \u5173\u95ed\u56fe\u5f62\u754c\u9762 }\n   <\/conio.h>\n  <\/graphics.h><\/pre> \n 
\n
\n

<\/p> \n

\"\\\"<\/p> \n

4 \u5728\u63a7\u5236\u53f0\u753b\u4e00\u4e2a\u65b9\u5757<\/strong><\/p> \n

<\/p> \n

\r\n#include \n  \n   \r\n#include \n   \n     #define PI 3.14159265 void main() { \/\/ \u521b\u5efa\u5927\u5c0f\u4e3a 800 * 600 \u7684\u7ed8\u56fe\u7a97\u53e3 initgraph(400, 300); \/\/ \u8bbe\u7f6e\u539f\u70b9 (0, 0) \u4e3a\u5c4f\u5e55\u4e2d\u592e\uff08Y\u8f74\u9ed8\u8ba4\u5411\u4e0b\u4e3a\u6b63\uff09 setorigin(200, 150); \/\/ \u4f7f\u7528\u85cf\u9752\u8272\u586b\u5145\u80cc\u666f setbkcolor(0x7c5731); cleardevice(); \/\/ \u8bbe\u7f6e\u7ed8\u56fe\u6837\u5f0f setlinecolor(WHITE); \/\/ \u8bbe\u7f6e\u7ebf\u6761\u989c\u8272\u4e3a\u767d\u8272 setlinestyle(PS_SOLID | PS_ENDCAP_FLAT, 10); \/\/ \u8bbe\u7f6e\u7ebf\u6761\u6837\u5f0f\u4e3a\u5bbd\u5ea6 10 \u7684\u5b9e\u7ebf\uff0c\u7aef\u70b9\u662f\u5e73\u7684 setfillcolor(0x24c097); \/\/ \u8bbe\u7f6e\u586b\u5145\u989c\u8272\u4e3a\u7eff\u8272 \/\/ \u753b\u65b9\u5757 fillroundrect(-75, -111, 75, 39, 36, 36); \/\/ \u6309\u4efb\u610f\u952e\u9000\u51fa _getch(); closegraph(); }\n   <\/conio.h>\n  <\/graphics.h><\/pre> \n 
\n
\n

<\/p> \n

\"\\\"<\/p> \n

5 \u661f\u7a7a<\/strong><\/p> \n

\u8fd9\u662f\u6765\u81eaeasyx\u7f51\u7ad9\u4e0a\u7684\u4e00\u4e2a\u8303\u4f8b\uff1b<\/p> \n

<\/p> \n

\r\n\/\/ \u7a0b\u5e8f\u540d\u79f0\uff1a\u661f\u7a7a\r\n\/\/ \u7f16\u8bd1\u73af\u5883\uff1aVisual C++<\/a> 6.0\uff0cEasyX 2011\u60ca\u86f0\u7248\r\n\/\/ \u6700\u540e\u66f4\u65b0\uff1a2009-2-22\r\n\/\/\r\n#include \n  \n   \r\n#include \n   \n     #include \n    \n      #define MAXSTAR 200 \/\/ \u661f\u661f\u603b\u6570 struct STAR { double x; int y; double step; int color; }; STAR star[MAXSTAR]; \/\/ \u521d\u59cb\u5316\u661f\u661f void InitStar(int i) { star[i].x = 0; star[i].y = rand() % 480; star[i].step = (rand() % 5000) \/ 1000.0 + 1; star[i].color = (int)(star[i].step * 255 \/ 6.0 + 0.5); \/\/ \u901f\u5ea6\u8d8a\u5feb\uff0c\u989c\u8272\u8d8a\u4eae star[i].color = RGB(star[i].color, star[i].color, star[i].color); } \/\/ \u79fb\u52a8\u661f\u661f void MoveStar(int i) { \/\/ \u64e6\u6389\u539f\u6765\u7684\u661f\u661f putpixel((int)star[i].x, star[i].y, 0); \/\/ \u8ba1\u7b97\u65b0\u4f4d\u7f6e star[i].x += star[i].step; if (star[i].x > 640) InitStar(i); \/\/ \u753b\u65b0\u661f\u661f putpixel((int)star[i].x, star[i].y, star[i].color); } \/\/ \u4e3b\u51fd\u6570 void main() { srand((unsigned)time(NULL)); \/\/ \u968f\u673a\u79cd\u5b50 initgraph(640, 480); \/\/ \u6253\u5f00\u56fe\u5f62\u7a97\u53e3 \/\/ \u521d\u59cb\u5316\u6240\u6709\u661f\u661f for(int i=0; i\n     \n      

<\/p>\n

\"\\\"<\/p>\n

6 \u5c4f\u5e55\u622a\u56fe<\/strong><\/p>\n

\u8fd9\u4e5f\u662f\u6765\u81eaeasyx\u7f51\u7ad9\u7684\u4f8b\u5b50\uff0c\u6f14\u793a\u4e86graphics.h\u4e5f\u53ef\u5728Win32\u7a0b\u5e8f\u4e2d\u4f7f\u7528\uff1b<\/p>\n

<\/p>\n

\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/ \u7a0b\u5e8f\u540d\u79f0\uff1a\u5b9e\u73b0\u684c\u9762\u622a\u56fe\r\n\/\/ \u7f16\u8bd1\u73af\u5883\uff1aVisual C++<\/a> 6.0 \/ 2010\uff0cEasyX 20130117(beta)\r\n\/\/ \u4f5c    \u8005\uff1ayangw80 \n       \n        \r\n\/\/ \u6700\u540e\u4fee\u6539\uff1a2013-1-29\r\n\/\/ \u9879\u76ee\u7c7b\u578b\uff1aWin32 Application\r\n\/\/\r\n#include \n        \n          \/\/ \u6293\u53d6\u684c\u9762\u56fe\u50cf\u5230 *pimg \u5bf9\u8c61\u4e2d void CaptureDesktop(IMAGE *pimg) { \/\/ \u901a\u8fc7 Windows API \u83b7\u53d6\u684c\u9762\u7684\u5bbd\u9ad8 int w = GetSystemMetrics(SM_CXSCREEN) \/ 2; int h = GetSystemMetrics(SM_CYSCREEN) \/ 2; \/\/ \u8c03\u6574 pimg \u7684\u5927\u5c0f Resize(pimg, w, h); \/\/ \u83b7\u53d6\u684c\u9762 DC HDC srcDC = GetDC(NULL); \/\/ \u83b7\u53d6 IMAGE \u5bf9\u8c61\u7684 DC HDC dstDC = GetImageHDC(pimg); \/\/ \u5728\u4e24\u4e2a DC \u4e4b\u95f4\u6267\u884c\u56fe\u50cf\u62f7\u8d1d\uff0c\u5c06\u684c\u9762\u6293\u56fe\u62f7\u8d1d\u5230 IMAGE \u5bf9\u8c61\u91cc\u9762 BitBlt(dstDC, 0, 0, w, h, srcDC, 0, 0, SRCCOPY); } \/\/ \u4e3b\u51fd\u6570 int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { \/\/ \u5b9a\u4e49 IMAGE \u5bf9\u8c61 IMAGE img; \/\/ \u8c03\u7528\u6293\u53d6\u684c\u9762\u56fe\u50cf\u7684\u51fd\u6570 CaptureDesktop(&img); \/\/ \u521b\u5efa\u7ed8\u56fe\u7a97\u53e3 initgraph(500, 300); \/\/ \u5728\u7a97\u53e3\u4e2d\u663e\u793a IMAGE \u4e2d\u4fdd\u5b58\u7684\u684c\u9762\u56fe\u50cf putimage(0, 0, &img); \/\/ \u6309 ESC \u952e\u9000\u51fa while(!(GetAsyncKeyState(VK_ESCAPE) & 0x8000)) Sleep(20); closegraph(); return 0; }\n        <\/graphics.h>\n       <\/yw80@qq.com><\/pre> \n      
\n
\n

<\/p> \n

\"\\\"<\/p> \n

7 \u505a\u4e00\u4e2a\u5b57\u7b26\u52a8\u753b<\/strong><\/p> \n

\u505a\u4e00\u4e2a\u5b57\u7b26\u4ece\u63a7\u5236\u53f0\u7a97\u53e3\u9876\u7aef\u5f80\u4e0b\u843d\u7684\u52a8\u753b\uff1b<\/p> \n

<\/p> \n

\r\n#include \n       \n        \r\n#include \n        \n          #include \n         \n           \/\/ \u4e3b\u51fd\u6570 void main() { initgraph(400, 300); \/\/ \u521d\u59cb\u5316\u5c4f\u5e55\u4e3a 640x480 srand(time(NULL)); \/\/ \u8bbe\u7f6e\u968f\u673a\u79cd\u5b50 setfont(16, 0, \"Arial\"); \/\/ \u8bbe\u7f6e\u5b57\u6bcd\u7684\u5b57\u4f53\u548c\u5927\u5c0f setfillstyle(BLACK); \/\/ \u8bbe\u7f6e\u6e05\u9664\u5b57\u6bcd\u7684\u586b\u5145\u533a\u57df\u989c\u8272 char target; \/\/ \u76ee\u6807\u5b57\u6bcd int x, y; \/\/ \u5b57\u6bcd\u7684\u4f4d\u7f6e \/\/ \u4e3b\u5faa\u73af while(true) { target = 65 + rand() % 26; \/\/ \u4ea7\u751f\u4efb\u610f\u5927\u5199\u5b57\u6bcd x = rand() % 380; \/\/ \u4ea7\u751f\u4efb\u610f\u4e0b\u843d\u4f4d\u7f6e for (y=0; y<280; y++) { setcolor(GREEN); \/\/ \u8bbe\u7f6e\u5b57\u6bcd\u7684\u989c\u8272 outtextxy(x, y, target); \/\/ \u663e\u793a\u5b57\u6bcd \/\/ \u5ef6\u65f6\uff0c\u5e76\u6e05\u9664\u5b57\u6bcd Sleep(10); bar(x, y, x + 16, y + 16); } } \/\/ \u5173\u95ed\u56fe\u5f62\u754c\u9762 closegraph(); }\n         <\/time.h>\n        <\/conio.h>\n       <\/graphics.h><\/pre> \n      
\n
\n

<\/p> \n

\"\\\"<\/p> \n

\u8fd8\u6709\u4e9b\u95ee\u9898\uff0c\u4e0b\u843d\u7684\u5b57\u6bcd\u4f1a\u62d6\u7740\u4e00\u4e2a\u767d\u8272\u5c3e\u5df4\uff1b\u4e0b\u6b21\u518d\u641e\uff1b<\/p> \n

8 \u6539\u8fdb<\/strong><\/p> \n

\u5728 VC \u4e2d\u521b\u5efa\u4ee3\u7801\u8bf7\u76f4\u63a5\u4f7f\u7528\u9ed8\u8ba4\u7684 .cpp \u6269\u5c55\u540d\uff0c\u4e0d\u8981\u52a0 .c \u6269\u5c55\u540d\u3002
\u5e76\u4e0d\u662f\u6240\u6709\u7684 TC \u7ed8\u56fe\u51fd\u6570\u90fd\u80fd\u652f\u6301\uff0c\u8bb8\u591a\u51fd\u6570\u5728 EasyX \u5e93\u4e2d\u90fd\u53d8\u5f97\u66f4\u5f3a\u5927\u4e86\uff0c\u6bd4\u5982\u989c\u8272\uff0c\u8fc7\u53bb TC \u53ea\u80fd\u652f\u6301 16 \u8272\uff0c\u73b0\u5728\u53ef\u4ee5\u652f\u6301\u4e0a\u5343\u4e07\u79cd\u989c\u8272\u3002\u8fd8\u6709\u5b57\u4f53\uff0c\u53ef\u4ee5\u4f7f\u7528 Windows \u4e0b\u5b89\u88c5\u7684\u4efb\u4f55\u5b57\u4f53\uff0c\u7b49\u7b49\u3002\u53c2\u8003\u5e2e\u52a9\u3002<\/p> \n

<\/p> \n

\u4e0a\u8ff0\u5de5\u7a0b\u4e0b\u8f7d<\/p> \n

http:\/\/pan.baidu.com\/s\/1o8qyWLs<\/p> \n

\u6587\u4ef6\u540d<\/p> \n

easyxdemo<\/p> \n <\/maxstar;>\n <\/conio.h>\n <\/time.h>\n <\/graphics.h><\/pre> \n<\/dd>","orderid":"0","title":"\u56fe\u89e3\u5728VC\u91cc\u4f7f\u7528graphics.h\u7ed8\u56fe(\u7c7b\u4f3cTC)","smalltitle":"","mid":"0","fname":"windows\u7f16\u7a0b\u57fa\u7840","special_id":"0","bak_id":"0","info":"0","hits":"691","pages":"1","comments":"0","posttime":"2016-04-23 17:39:07","list":"1461404347","username":"admin","author":"","copyfrom":"","copyfromurl":"","titlecolor":"","fonttype":"0","titleicon":"0","picurl":"http:\/\/www.cppentry.com\/upload_files\/article\/55\/1_lkryj__.png","ispic":"1","yz":"1","yzer":"","yztime":"0","levels":"0","levelstime":"0","keywords":"\u56fe\u89e3<\/A> \u4f7f\u7528<\/A> graphics.h<\/A> \u7ed8\u56fe<\/A> \u7c7b\u4f3c<\/A>","jumpurl":"","iframeurl":"","style":"","template":"a:3:{s:4:\"head\";s:0:\"\";s:4:\"foot\";s:0:\"\";s:8:\"bencandy\";s:0:\"\";}","target":"0","ip":"14.17.22.31","lastfid":"0","money":"0","buyuser":"","passwd":"","allowdown":"","allowview":"","editer":"","edittime":"0","begintime":"0","endtime":"0","description":"\u56fe\u89e3\u5728VC\u91cc\u4f7f\u7528graphics.h\u7ed8\u56fe(\u7c7b\u4f3cTC)","lastview":"1490223931","digg_num":"0","digg_time":"0","forbidcomment":"0","ifvote":"0","heart":"","htmlname":"","city_id":"0"},"page":"1"}