SetOpacity documentation
Hi!
I had quite a problem with this function: void Brush::SetOpacity(float opacity);
I think that the implementation of this is quite different form what average person would guess. At least I would guess that SetOpacity(0.5f) would set opacity to ~0x7F, SetOpacity(1.0f) would set it to ~0xFF etc... The actual behavior is SetOpacity(0.5f) sets opacity to "xaml defined opacity" * 0.5
I would say it deserves better documentation (the current description "Gets/Sets Opacity" leaves me quite confused).
cheers,
matejr5
I had quite a problem with this function: void Brush::SetOpacity(float opacity);
I think that the implementation of this is quite different form what average person would guess. At least I would guess that SetOpacity(0.5f) would set opacity to ~0x7F, SetOpacity(1.0f) would set it to ~0xFF etc... The actual behavior is SetOpacity(0.5f) sets opacity to "xaml defined opacity" * 0.5
I would say it deserves better documentation (the current description "Gets/Sets Opacity" leaves me quite confused).
cheers,
matejr5
-
sfernandez
Site Admin
- Posts: 2984
- Joined:
Re: SetOpacity documentation
Yes, we wil improve the documentation text of Brush properties to better explain their meaning.
The Brush.Opacity property is used to control opacity of the brush in a generic way, no matter which kind of brush you are using: SolidColorBrush, LinearGradientBrush, RadialGradientBrush, ImageBrush... That opacity value is used during rendering, it doesn't modify other brush properties.
The Brush.Opacity property is used to control opacity of the brush in a generic way, no matter which kind of brush you are using: SolidColorBrush, LinearGradientBrush, RadialGradientBrush, ImageBrush... That opacity value is used during rendering, it doesn't modify other brush properties.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 15 guests