简体   繁体   English

reportviewer如何使矩形背景透明

[英]reportviewer How to make rectangle background transparent

I have 3 rectangles that differ from each other in opacity. 我有3个互不相同的矩形。 The base color is same for all of them. 所有底色都相同。 For eg: the base color could be Red and the three rectangles would have the following colors: Red, Red (opacity: 55), Red (opacity: 135). 例如:基色可以是红色,而三个矩形将具有以下颜色:红色,红色(不透明度:55),红色(不透明度:135)。

I tried setting the Background Color of the rectangle but it seems I cannot change the transparency of a rectangle. 我尝试设置矩形的Background Color ,但似乎无法更改矩形的透明度。 Is there a workaround for this? 有没有解决方法?

Thank you! 谢谢!

It turns out that this is a limitation of reportviewer. 事实证明,这是reportviewer的局限性。 Opacity values can be given to only gauges and graphs. 不透明度值只能提供给仪表和图表。 Shapes and fonts do not accept opacity values. 形状和字体不接受不透明度值。 A close workaround to this is to add the opacity value to RGB. 一个接近的解决方法是将不透明度值添加到RGB。 For example: if I want to generate a color in RGBA as (255,0,0,160) , I should add 255-160=95 to the values of G and B to get a color close to my needs. 例如:如果要在RGBA as (255,0,0,160)生成颜色RGBA as (255,0,0,160) ,则应在G和B的值上加上255-160=95 ,以获得接近我需要的颜色。 Therefore the color turns out to be (255,95,95) . 因此颜色原来是(255,95,95) It is not the exact color but it is close. 它不是确切的颜色,但是很接近。 I tried this for red, blue and green colors since those are the only colors I need. 我尝试了红色,蓝色和绿色,因为这些是我唯一需要的颜色。

I hope this helps someone. 我希望这可以帮助别人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM