五月天青色头像情侣网名,国产亚洲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;

}

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

分享到微博請遵守國家法律
玛曲县| 呈贡县| 玛多县| 运城市| 南溪县| 临安市| 新野县| 红安县| 安图县| 云安县| 昌黎县| 永泰县| 年辖:市辖区| 隆子县| 新乡县| 奇台县| 江源县| 宁津县| 石渠县| 策勒县| 康保县| 霍邱县| 息烽县| 阳曲县| 堆龙德庆县| 正宁县| 五寨县| 东台市| 北宁市| 青浦区| 灌云县| 闸北区| 新巴尔虎右旗| 晋宁县| 都兰县| 吴堡县| 思茅市| 铜梁县| 宁都县| 牙克石市| 瓦房店市|