보다 많은 내용 : The Game Programming Wiki

void DWORD_To_RGBA(DWORD color, BYTE& r, BYTE& g, BYTE& b, BYTE& a)
{
	r = (color & 0xFF000000) >> 24;
	g = (color & 0x00FF0000) >> 16;
	b = (color & 0x0000FF00) >> 8;
	a = (color & 0x000000FF);
}

void RGBA_To_DWORD(DWORD& color, BYTE r, BYTE g, BYTE b, BYTE a)
{
	color = (r << 24) | (g << 16) | (b << 8) | a;
}

+ Recent posts