如何给水印图片设置透明度呢,不要给一堆源码!求个思路!原理!!

解决方案 »

  1.   

    设SolidBrush的alpha值
    colorMatrixElements 设置透明度
    float[][] colorMatrixElements = {  
      new float[] {1.0f, 0.0f, 0.0f, 0.0f, 0.0f},  
      new float[] {0.0f, 1.0f, 0.0f, 0.0f, 0.0f},  
      new float[] {0.0f, 0.0f, 1.0f, 0.0f, 0.0f},  
      new float[] {0.0f, 0.0f, 0.0f, (float)透明度/100f, 0.0f},  
      new float[] {0.0f, 0.0f, 0.0f, 0.0f, 1.0f}};  
      ColorMatrix wmColorMatrix = new ColorMatrix(colorMatrixElements);