五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

[C/C++/Easyx]07 消息處理—漂亮的按鈕

2023-08-19 17:26 作者:bili_80498477832  | 我要投稿

交作業(yè)doge, 自己加了點(diǎn)陰影效



#include<stdio.h>

#include<easyx.h>

#include <graphics.h>


ExMessage msg = { 0 };


bool button(int butx, int buty,int butw, int buth , const char* test) {//butx y為按鈕位置


??//繪制按鈕

??setfillcolor(BLACK);//陰影+

??solidroundrect(butx, buty, butx + butw +3, buty + buth+5, 20, 40);//+

??setlinecolor(BLACK);

??setlinestyle(PS_SOLID, 3);

??setfillcolor(RGB(200, 111, 103));

??fillroundrect(butx, buty, butx + butw, buty + buth, 20, 40);


??//繪制文本

??settextcolor(BLACK);

??int hspace = (butw - textwidth(test)) / 2;

??int wspace = (buth - textheight(test)) / 2;

??outtextxy(butx + hspace, buty + wspace, test);


??//鼠標(biāo)在這個(gè)區(qū)域?

??if (msg.x > butx && msg.x < butx + butw && msg.y > buty && msg.y < buty + buth) {

????setfillcolor(RED);

????fillroundrect(butx, buty, butx + butw, buty + buth, 20, 40);

??}


??//鼠標(biāo)在這個(gè)區(qū)域并且單機(jī)了左鍵?

??if (msg.message==WM_LBUTTONDOWN && msg.x > butx && msg.x < butx + butw && msg.y > buty && msg.y < buty + buth) {

????return true;

??}

??return false;???

}

int main() {


??//建立窗口

??initgraph(640, 480, EX_SHOWCONSOLE );

??setbkcolor(RGB(242, 222, 189));

??cleardevice();

??setbkmode(TRANSPARENT);//設(shè)置文字背景透明


??//

??while (true) {

????if (peekmessage(&msg, EX_MOUSE)) {//獲取鼠標(biāo)信息+

????}

????BeginBatchDraw();//

????if (button(180, 300, 100, 50, "Play")) {//x, y, wide, heigh, text

??????printf("Game Start\n");

????}

????if (button(380, 300, 100, 50, "Quit")) {//x, y, wide, heigh, text

??????printf("Closing...\n");

????}

????EndBatchDraw();

????msg.message = 0;

??}


??//保持顯示

??getchar();

??closegraph();

??return 0;

[C/C++/Easyx]07 消息處理—漂亮的按鈕的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
通渭县| 郴州市| 茂名市| 玉屏| 鲁甸县| 景泰县| 高雄市| 临安市| 修水县| 军事| 三江| 资阳市| 分宜县| 彝良县| 察雅县| 汨罗市| 溧阳市| 南岸区| 黄骅市| 无为县| 青神县| 饶阳县| 龙泉市| 宜州市| 尼木县| 台北市| 武威市| 读书| 桦南县| 上思县| 巴林右旗| 陆川县| 临漳县| 南昌县| 尚义县| 开阳县| 铁力市| 成都市| 海林市| 万年县| 江孜县|