title: Alpha blending colors in .NET Compact Framework 2.0
body: <p>In the Full .NET framework you can use the Color.FromArgb() method to create a new color with alpha blending, like this:</p>
  
  <pre><code>Color blended = Color.FromArgb(alpha, color);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>Color blended = Color.FromArgb(alpha, red, green , blue);
  </code></pre>
  
  <p>However in the Compact Framework (2.0 specifically), neither of those methods are available, you only get:</p>
  
  <pre><code>Color.FromArgb(int red, int green, int blue);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Color.FromArgb(int val);
  </code></pre>
  
  <p>The first one, obviously, doesn't even let you enter an alpha value, but the documentation for the latter shows that "val" is a 32bit ARGB value (as 0xAARRGGBB as opposed to the standard 24bit 0xRRGGBB), so it would make sense that you could just build the ARGB value and pass it to the function.  I tried this with the following:</p>
  
  <pre><code>private Color FromARGB(byte alpha, byte red, byte green, byte blue)
  {
      int val = (alpha &lt;&lt; 24) | (red &lt;&lt; 16) | (green &lt;&lt; 8) | blue;
      return Color.FromArgb(val);
  }
  </code></pre>
  
  <p>But no matter what I do, the alpha blending never works, the resulting color always as full opacity, even when setting the alpha value to 0.</p>
  
  <p>Has anyone gotten this to work on the Compact Framework?</p>