My app has a text with Gradient on a canvas and I move it around&change the Opacity
textblock.Foreground = new SolidColorBrush(
Color.FromArgb((Byte)opacitiycounter, 255, 255, 0));
That works great- but for SolidColorBrush. The challange I got myself into was to change the opacity of a given Gradient:
public Points(TextBlock t, GradientBrush color) {
color.Opacity = opacitiycounter;
t.Foreground = color;
}
The opacity function doesn't seem to work and I can't find another way that I can control the given Gradient Opacity, do I need to create entire new Gradient each time with the old values and change the alpha at each point? if thats the case how do I even copy a gradient?
edit: I'm trying to edit existing gradient dynamically in WPF.