Draw text on a .net Control with negative color of the background - blend

前端 未结 2 559
天涯浪人
天涯浪人 2021-01-19 01:53

I\'d like to draw a progress bar with percentage in its center, but I\'d like the text to have negative (contrasted) color of the

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-19 02:24

    You can use XOR to calculate the negative (inverted) color;

    Public Function InvertColor(color As Long) As Long
        Return (color Xor &HFFFFFF)
    End Function
    

提交回复
热议问题