473,385 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

mediatimeline in storyboard in C#

Hi

My goal is to create storyboard containing text, pictures and video. I
have already displayed text and graphics using DoubleAnimation. My
question is how to insert mediatimeline in such a way that video will
be played at desired time. I have tried to do this in XAML since this
is fairly easier but my problem was that video covered all the
pictures even if it hasn't been played yet.

Here is my C# code:

Rectangle rect = new Rectangle();
rect.Name = "myRectangle";
rect.Width = 300;
rect.Height = 300;

asd.Children.Add(rect);

NameScope.SetNameScope(this, new NameScope());

Image one = new Image();
one.Source = new BitmapImage(new Uri("C:\\users\\pkolodzi\
\DSC03721.1.jpg"));

MediaElement me = new MediaElement();
me.Source = new Uri("C:\\users\\pkolodzi\\movie.avi");
me.Name = "movie1";

MediaTimeline mtl = new MediaTimeline();
mtl.BeginTime =
TimeSpan.Zero.Add(TimeSpan.FromSeconds(2));

this.RegisterName(me.Name, me);
this.RegisterName(rect.Name, rect);

rect.Opacity = 0;
VisualBrush vb = new VisualBrush(one);
vb.Stretch = Stretch.UniformToFill;
rect.Fill = vb;

DoubleAnimation da1 = new DoubleAnimation();
da1.BeginTime = TimeSpan.Zero;
da1.From = 0;
da1.To = 1;
da1.Duration = new Duration(TimeSpan.FromSeconds(1));
Storyboard.SetTargetName(da1, rect.Name);
Storyboard.SetTargetProperty(da1, new
PropertyPath(Image.OpacityProperty));

Storyboard.SetTargetName(mtl, me.Name);
// I guess i have to settarget property here but don't
know which one

Storyboard mySb = new Storyboard();
mySb.Children.Add(da1);
mySb.Children.Add(mtl);
mySb.RepeatBehavior = new RepeatBehavior(10);
mySb.Begin(this);

Sep 26 '07 #1
0 1194

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: indhu | last post by:
Private Sub cmdsave_Click() If imagebox.Picture = LoadPicture("") Then MsgBox "Please browse the image you want to add to your database.", vbExclamation, "Image required" browseimage ...
4
by: indhu | last post by:
hi all, Tables: story, shot story-fieldnames, project, date episode shot-fieldnames, scene,shot, filename(imagepath),action and dialogue. Form has field from both the tables. how do i fetch...
20
by: jung | last post by:
Hello!. can anyone help me? i have develop a simple program for quering programs and the tables they use. now, the problem is about how to display the correct total number of tables a...
1
by: indhu | last post by:
Hi all, I want 2 know, how to populate using 2 combo box to populate other field. right now am using click event of combo to populate the other field but i want to select both combo1 and combo2 ...
4
by: indhu | last post by:
Hi i am getting this kind of error while saving the records this error comes. runtime error: you cannot add or change a record because a related record is required in table scene Private Sub...
2
by: indhu | last post by:
Hi its not working, i want only distinct record. here its repeated records coming. accdb = "SELECT DISTINCT sequence FROM scene WHERE sceneid = '" & myquery & "' " and when i select the...
55
by: indhu | last post by:
HI all one sequence has many panels. when i select combo it displays all the fields but panel has more rows. i want to view that also. how to do that? move next and previous commds are there...
0
by: gregbacchus | last post by:
I am trying to make an animated Expander, that slides open and closed. It works fine, however when in put another Expander inside it, the triggers/routed events seem to get a little confused. When...
1
by: William Johnston | last post by:
Hi, I modified a thumbnail creation app and get black images since the first second is black as well. My questions are: 1. How do I set the MediaPlayer.Clock property to start screen capture...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.