开发者

How to set the Ellipse to change color when the video played until that specific timing in WPF

I have a video which last for 12 sec, and 2 ellipse which I have added in wpf... What I want is when the video reached eg at the 3 sec of that video, the 1st ellipse will be in red color. When it reached 5 sec of the video, another ellipse will be in blue color.. Is a sort of progress dots which is to indicate the progress of the video. so that user will kno开发者_C百科w that the 2 ellipse are the key frames of that video.

Thanks.


Assuming, you are using MediaElement:

A. If you have only two (or three) ellipsis, bind the color property of Ellipse to the Position Property of MediaElement, create a converter and use it for this binding. If relative position is required, you might have to use multibinding against Position and NaturalDuration properties of MediaElement.

B. If you want a stream of ellipsis, better way is to bind a progressbar with Position property of MediaElement (as in A above), and then modify the ControlTemplate of progressbar to use ellipsis.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜