国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(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;

}

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

分享到微博請遵守國家法律
微山县| 如东县| 青田县| 哈尔滨市| 攀枝花市| 清涧县| 大足县| 资溪县| 南宫市| 图们市| 集贤县| 蓝山县| 灵宝市| 鄂托克旗| 昌吉市| 镇巴县| 荃湾区| 江孜县| 麻栗坡县| 玉屏| 平邑县| 崇信县| 永泰县| 萨迦县| 岐山县| 托克逊县| 自贡市| 昌邑市| 蓝田县| 施秉县| 府谷县| 绥宁县| 鹤庆县| 龙南县| 东源县| 个旧市| 德州市| 含山县| 即墨市| 江都市| 诏安县|