积极答复者
在PPC上画透明背景的图片

问题
-
有哪位高手知道在PPC上画具有透明背景的图片吗?
我是这样画的,但是效果不好,不知道有没有更好的方法!!
System.Drawing.Imaging.ImageAttributes Attr = new System.Drawing.Imaging.ImageAttributes();
Attr.SetColorKey(Color.FromArgb(240, 0, 86), Color.FromArgb(240, 0, 86));//品红
graphics.DrawImage(m_BtnImage, new Rectangle(m_x, m_y, m_witdh, m_height),
0, 0, m_BtnImage.Width, m_BtnImage.Height, GraphicsUnit.Pixel, Attr);
图片是PNG的透明背景图片,在PC上显示具有透明,但是在PPC上显示的是白色背景;用上面的方法去除后会有锯齿,并且还有杂色!
答案
-
你好,可以试试AlphaBlending,Alex已经封装好的函数,使用P/Invoke调用。
Alpha Blending and Alpha Channel on Windows Mobile
这篇BLog上有一些资源可以用。
施炯- 已标记为答案 Guang-Ming Bian - MSFTModerator 2010年1月18日 3:16
-
一般有两种办法:
1. AlphaBlend() function
2. Image COM object in the Imaging API.
具体示例请看:
http://blogs.msdn.com/chrislorton/archive/2006/04/07/570649.aspx
Please remember to mark the replies as answers if they help and unmark them if they provide no help- 已标记为答案 Guang-Ming Bian - MSFTModerator 2010年1月18日 3:16
全部回复
-
你好,可以试试AlphaBlending,Alex已经封装好的函数,使用P/Invoke调用。
Alpha Blending and Alpha Channel on Windows Mobile
这篇BLog上有一些资源可以用。
施炯- 已标记为答案 Guang-Ming Bian - MSFTModerator 2010年1月18日 3:16
-
一般有两种办法:
1. AlphaBlend() function
2. Image COM object in the Imaging API.
具体示例请看:
http://blogs.msdn.com/chrislorton/archive/2006/04/07/570649.aspx
Please remember to mark the replies as answers if they help and unmark them if they provide no help- 已标记为答案 Guang-Ming Bian - MSFTModerator 2010年1月18日 3:16