如何用GDI+实现在图片上打半透明文字?   wingfancyx解决过这个问题,能讲讲如何实现吗?用AlphaBlend只能实现DC和DC整体半透过效果。
但是如果只想透明DC上的文字怎么办?
不规则的区域呢?

解决方案 »

  1.   

    关键是获得文字的Mask.我想检查一下DC的数据就有了。
      

  2.   

    GDI itself does not support alpha-blending on vector elements (text, primitive shapes,...). Text cannot be drawn using alpha-blending by GDI (GDI+). One solution is create a bitmap, draw text on it and then alpha-blend bitmap to second bitmap or screen. The Second solution is to create your own alpha-blending routine but In this case, you'd need to handle text drawing all by yourself and do some complex polygon filling which is far from easy.
      

  3.   

    gdi+是可以做到了,我软件加密时,就是用的GDI+作水印
      

  4.   

    我现在用GDI也可以做,虽然麻烦一些,但我做了相关的接口,每次用的时候只要调用接口就可以了