Replies: 14 comments 2 replies
-
@darinkes Could you try with new |
Beta Was this translation helpful? Give feedback.
-
I'm seeing the same behavior as @darinkes using both the Image and Svg controls in Avalonia.Svg.Skia version 0.10.6.1. |
Beta Was this translation helpful? Give feedback.
-
This is an issue in AvaloniaUI with how opacity is blended when using custom draw operation |
Beta Was this translation helpful? Give feedback.
-
I have hack fix for that, but not really want it to use #79 |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick hack! I tried it out, and it works now when the Opacity is applied directly to the Svg control, but it still doesn't work when the Opacity is inherited from the parent control. I can work around this by just duplicating a little code, but inheriting the Opacity from the parent would certainly be ideal. |
Beta Was this translation helpful? Give feedback.
-
Without Avalonia fixing this in core library this hack is best I can do. |
Beta Was this translation helpful? Give feedback.
-
@wieslawsoltes thanks for taking a look at it! Should we open an issue at Avalonia? |
Beta Was this translation helpful? Give feedback.
-
@darinkes It is known issue, no need to create new one |
Beta Was this translation helpful? Give feedback.
-
One year later, Avalonia v0.10.15, Avalonia.Svg.Skia v0.10.14 -- I still have that issue. Opacity is not respected.
|
Beta Was this translation helpful? Give feedback.
-
There is still this problem, can it be solved? |
Beta Was this translation helpful? Give feedback.
-
There is still this problem |
Beta Was this translation helpful? Give feedback.
-
I had a very specific use case ... so I just opened the SVG file and set <svg opacity="0.3">
...
</svg> |
Beta Was this translation helpful? Give feedback.
-
Another workaround I am using is the DrawingImage method. You can expose the opacity and also the GeometryDrawing brush to let you set the opacity and the fill color for SVG as well. To get the geometry data, you can use the author's tool to help you get them into xaml code. <Image Opacity="value">
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V100 H100 V0 H0 Z">
<GeometryDrawing Brush="#FF000000" Geometry="SVG d" />
<GeometryDrawing Brush="#FF000000" Geometry="SVG d" />
...
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image> |
Beta Was this translation helpful? Give feedback.
-
To fix this issue, add |
Beta Was this translation helpful? Give feedback.
-
I noticed you can't fade away an Image with SvgImage Source.
Not sure if this is a limitation of Svg.Skia or Svg itself.
ContentPresenter includes a TextBlock and an Image. Only the TextBlock gets slowly invisible.
The Image only disapears as soon as Opacity becomes 0.0
Beta Was this translation helpful? Give feedback.
All reactions