Closed seghier closed 1 year ago
Could you please clarify: the background of what? Of a particular formula element or of the whole control?
Thanks, i find a solution to set the background of the image
If you can replace brush with System.Drawing.Color this will be better .....SetBackground(System.Drawing.Color)
var mediaBackClr = System.Windows.Media.Color.FromArgb(backClr.A, backClr.R, backClr.G, backClr.B);
var backsolidbrush = new System.Windows.Media.SolidColorBrush(mediaBackClr);
var backBrush = WpfMath.Rendering.WpfBrush.FromBrush(backsolidbrush);
latexformula.SetBackground(backBrush);
Ok, now I see what you mean.
Unfortunately, I don't think we are going that way.
While not exactly, System.Drawing.Color
is mostly associated with Windows Forms and not WPF; as you can see, WPF uses its own color types (while, for simple coloring, they directly correspond to each other).
WPF part of XAML Math is only going to deal with WPF types. Aside from color types, this allows you to apply any WPF brush to select coloring, even a texture brush or whatnot.
We will be developing a separate Windows Forms backend (#378), though, that will allow you to use WinForms Brush
instead. And that one is a bit easier to construct from a System.Drawing.Color
.
Note that it will never be possible to mix WPF rendering and Windows Forms brushes, though.
Hi Thank you for this useful tool How to use SetBackground to change the background from transparent to another color?