How to access the Material of an Image (UIControl) in code?

As shown in the image, I created a GUI Material and assigned it to the Material property of a UIControl Image. Now, I don’t know how to access this Material via code in order to manipulate its parameters.

public class ImageCtrl : Script
{
    public UIControl ImageFillTest;
    [Range(0, 1)]
    public float Fill;

    public override void OnStart()
    {
        TrySetImageFill(Fill);
    }


    void TrySetImageFill(float fill)
    {
        var img = ImageFillTest.Get<Image>();
        if (img == null) return;
        // img.Material ?
    }
}

Additionally, I’d like to achieve an effect similar to Unity’s Image Fill. Is this the correct approach?

I found that the ProgressBar’s Bar Brush can achieve filling effects in horizontal or vertical directions.

But I still need to solve this issue, as I also require a radar-style filling effect (like the cooldown effect on skill icons), and a dissolution effect based on a noise map (similar to the effect of paper burning away).

I’ve figured it out! If any beginners encounter the same problem, feel free to take a look.

var matBrush = ImageFillTest.Get<Image>()?.Brush as MaterialBrush;
if (matBrush == null) return;
_fillParam = matBrush.Material?.GetParameter(paramName);
if (_fillParam == null) return;
_fillParam.IsOverride = true;
_fillParam.Value = FillValue;