How can I convert from DWORD RGBA to ints?
<p>I have to convert a DWORD (unsigned long) RGBA to four int vars (R, G, B, and A)
So far, I have this function to convert the 4 ints to a DWORD:</p>

<pre><code>unsigned long RGBA2DWORD(int iR, int iG, int iB, int iA)
{
 return ((iA &lt;&lt; 24) | (iR &lt;&lt; 16) | (iG &lt;&lt; 8) | iB);
}
</code></pre>

<p>How can I convert it back?</p>

<p>Something like</p>

<pre><code>struct RGBA
{
 int R, G, B, A;
};

RGBA DWORD2RGBA(unsigned long dwColor)
{
 static RGBA tmp;
 //.......conversion process
 return tmp;
}
</code></pre>

<p>Any kind of help would be appreciated! :)</p>

<p>Thanks</p>
