C# compact framework : load a png alpha blending file -


I have a PGG image file that has alpha blending, now I want to load it on a form on any mobile. I tried many ways but do not work, is there a solution? Thanks in advance. I use this to load the image from the resource:

  stream stream = assembly Gate unexpected suspend (). GetManifestResourceStream ("drawObj.Graph.png"); Bitmap myPNGImg ​​= new bitmap (stream);  

Then create a new bitmap with the same size of images. Graph:

  Bitmap myBlankImg = new bitmap (48,48); Graphics mynew Graph = Graphics.frim image (myNew); MynewGraph.Clear (Color.Transparent);  

Dry PNG Bitmap: mynewGraph.DrawImage (myPNGImg, 0, 0); and then I read something from the Internet: (

  Rectangle rectDest = new rectangle (50,50, 100, 100); Image images imgatt = new image properties (); imgatt. SetColorKey (Color.Transparent, Color.Transparent); myGraph.DrawImage (myNew, rectDest, 0, 0 It works but clarifies the four corners of the pictures (some raucous of rounded rectangle). Still around the images There is some white border on the left. Loading the images using bitmap on compact framework will lose alpha information. Optional option. 

To use alpha blending on the compact framework, you can use alphanumeric sections to open the PNG file, to support alpha information, then see P / P Do not be beautiful, but this is what it takes. Be warned that you will hit a whopping performed using alpha blending. To bake some pictures dynamically, it's fine, but for generic on screen drawing tasks, you may want to use another approach.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -