DXライブラリ 総合スレッド その12
レス数が900を超えています。1000を超えると表示できなくなるよ。
0918名前は開発中のものです。
2012/05/28(月) 05:01:17.17ID:fvu7wQ0B// r, g, bの色を透過色とみなした白マスクを下に繋げて作成。alphacheckを1にするアルファ値0も透過する。
// AllNum以降はLoadDivGraph系と同じ(ただし複製後の画像を想定して指定すべし)。
int LoadDivGraphWhiteMaskDup(const wchar *infile, int r, int g, int b, int alphacheck,
int AllNum, int XNum, int YNum, int SizeX, int SizeY, int *HandleBuf) {
int inhandle = LoadSoftImage(infile);
int w, h;
GetSoftImageSize(inhandle, &w, &h);
int outhandle = MakeARGB8ColorSoftImage(w, h*2);
BltSoftImage(0, 0, w, h, inhandle, 0, 0, outhandle);
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
int tr, tg, tb, ta;
GetPixelSoftImage(inhandle, x, y, &tr, &tg, &tb, &ta);
if ((tr == r && tg == g && tb == b) || (alphacheck && ta == 0))
DrawPixelSoftImage(outhandle, x, y+h, 0, 0, 0, 0);
else
DrawPixelSoftImage(outhandle, x, y+h, 255, 255, 255, 255);
}
}
int outgraph = CreateDivGraphFromSoftImage(outhandle, AllNum, XNum, YNum, SizeX, SizeY, HandleBuf);
DeleteSoftImage(inhandle);
DeleteSoftImage(outhandle);
return outgraph;
}
レス数が900を超えています。1000を超えると表示できなくなるよ。