I'm trying to make a circle animate it's fill using a sinewave. Here's an example image I made:
So the black is the circle, and as you can see it's cut off in a sine-wave-like way. Can you do this while the sine-wave is "traveling" in a horizontal direction and deciding where the wave should be placed by an Y value of the circles full height? (to make it look like there's water in the circle creating waves on top and being able to decide how much "water" is in the circle)
Are there a way to do this? Maybe there's some place to read up on these kinds of animations at?
One thing to note is that the grey background represents transparency so the "cut off" part of the circle should be transparent.
The main feature to do something like this is an OpacityMask. The example below uses a VisualBrush set to Tile for the mask and uses the transform property of the brush to do the motion you described.
To hide the mask you could place it directly inside VisualBrush instead of a binding like above. You may also want to look at other types of brushes and their transforms and viewport/viewbox.
Update: The mask is now in two pieces so the wave amplitude can be adjusted separately. You can also adjust
ScaleTransform.ScaleX
to alter the frequency but you would need to make sure you get the whole wave or the animation stutters, e.g try0.5,0.25,0.1