How to mask Bitmap with LinearGradient shader properly?

后端 未结 1 1717
长情又很酷
长情又很酷 2021-02-15 14:17

I\'m trying to mask Bitmap with gradient alpha at bottom. Gradient size are fixed and independed of Bitmap size. But it draws incorrect: bottom of gradient at top, than top. Wha

相关标签:
1条回答
  • 2021-02-15 14:57

    Change your LinearGradient to this:

        LinearGradient shader = new LinearGradient(0,  h - GRADIENT_HEIGHT, 0, h, 0xFFFFFFFF, 0x00FFFFFF, Shader.TileMode.CLAMP);
    
    0 讨论(0)
提交回复
热议问题