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

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

游戲微小更新,油庫里可以“左顧右盼”了

2023-07-13 22:20 作者:childlizr  | 我要投稿

以下是相關代碼,有問題隨便問,有bug隨便提。

雖然是咱自己想出來的,但是肯定有雷同,咱懶得去找,反正能達到目的就行。

測試方法在注釋里。


#include <easyx.h>

#include <conio.h>

//運行后隨便按一個字母鍵后,圖片水平翻轉。

//圖片需要自己準備,為png格式,名稱改為test.png,和這個源文件放在同一文件夾

class youkuli

{

protected:

IMAGE* body;

public:

youkuli()

{

this->body = new IMAGE;

loadimage(this->body, L"./test.png");

}

~youkuli()

{

delete this->body;

this->body = nullptr;

}

void flip_horizontal()//將圖片水平翻轉(水平鏡像)

{

DWORD* tem_picture = GetImageBuffer(this->body);//身體原圖片(將要被修改的)

IMAGE base = *(this->body);//備用(不變的)

DWORD* base_picture = GetImageBuffer(&base);//備用(不變的)

int R = 0, G = 0, B = 0;

int max = this->body->getheight() * this->body->getwidth();

int i_for_tem = 0;//被改寫的點的下角標

int where_x = 0, where_y = 0;//不變的那個圖的點的對應坐標

while (i_for_tem < max)

{

if (where_x == this->body->getwidth())//換行

{

where_x = 0;

where_y++;

}

auto get_order = [&i_for_tem, this, &where_y]()//得到翻轉后的下角標

{

return ((this->body->getwidth() - (i_for_tem % this->body->getwidth())) + where_y * this->body->getwidth());

};

R = GetRValue(base_picture[get_order()]);

G = GetGValue(base_picture[get_order()]);

B = GetBValue(base_picture[get_order()]);

tem_picture[i_for_tem] = RGB(R, G, B);

where_x++;

i_for_tem++;

}

}

void draw(int x, int y)

{

putimage(x, y, this->body);

}

};

int main()

{

initgraph(1000, 600);

youkuli* test = new youkuli();

setbkcolor(BLACK);

BeginBatchDraw();


while (1)

{

test->draw(10,10);

FlushBatchDraw();

//_getch();

test->flip_horizontal();

test->draw(10,10);

FlushBatchDraw();

_getch();

}

return 0;

}

游戲微小更新,油庫里可以“左顧右盼”了的評論 (共 條)

分享到微博請遵守國家法律
麻江县| 临沂市| 彰化市| 卫辉市| 永和县| 凤庆县| 弥渡县| 昌都县| 武定县| 安岳县| 正蓝旗| 古交市| 家居| 房山区| 赤城县| 广平县| 安新县| 嫩江县| 夏河县| 资中县| 苍山县| 溧阳市| 鹤壁市| 徐州市| 建湖县| 崇明县| 江源县| 岐山县| 靖安县| 平阴县| 太和县| 合肥市| 梨树县| 芦山县| 大英县| 香格里拉县| 巴林左旗| 简阳市| 双柏县| 淳化县| 江西省|