title: C# compact framework : load a png alpha blending file
body: <p>I have a png image file with alpha blending of its own. Now I want to load it onto a form in a mobile. I tried so many ways but not work. Is there any solution? Thanks in advance.
  This is what I use to load the image from resource:</p>
  
  <pre><code>Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("drawObj.Graph.png");
  Bitmap myPNGImg = new Bitmap(stream);
  </code></pre>
  
  <p>Then create new bitmap with same size of the images Graph.png:</p>
  
  <pre><code>Bitmap myBlankImg = new Bitmap(48,48);
  
  Graphics  mynewGraph = Graphics.FromImage(myNew);
  
  mynewGraph.Clear(Color.Transparent);
  </code></pre>
  
  <p>Draw the PNG bitmap: <code>mynewGraph.DrawImage(myPNGImg, 0, 0);</code>
  And then something I read from internet:(</p>
  
  <pre><code>Rectangle rectDest = new Rectangle(50,50, 100, 100);
  
  ImageAttributes imgatt = new ImageAttributes();
  
  imgatt.SetColorKey(Color.Transparent, Color.Transparent);
  
  myGraph.DrawImage(myNew, rectDest, 0, 0, 99, 99,GraphicsUnit.Pixel, imgatt);
  </code></pre>
  
  <p>It works, but just clear the four corner of the images(somekind of rounded rectangle). There's still some white border around the images left.</p>