473,465 Members | 1,489 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to Create a Video in windows form application?? (with pic, maybe flv)

sword117
35 New Member
im trying to use frames to create a video in the windows form application everything works if the first FOR is <10, if is > to 10 an error appears saying "FileNotFoundException was unhandled". i need serious help, and if there is a way to use another type of extension(example:flv,wmv,tiff) please help me too with that. thanks ;)

Expand|Select|Wrap|Line Numbers
  1.  Image[] images = new Image[2003];
  2.             for (int i = 1; i < 2004; i++)
  3.             {
  4.                 images[i] = Image.FromFile(@"C:\New folder (6)\000" + i +".jpg");
  5.                 this.BackgroundImage = images[i];
  6.             }
Jul 8 '10 #1
5 1981
hype261
207 New Member
@sword117
The reason an exception is being thrown is because the app can't find a file named 00010.jpg. I would look to ensure that file exists. You should also surround your code with a try catch block so the exception can be properly handled.
Expand|Select|Wrap|Line Numbers
  1. try
  2. {
  3. //your code here
  4. }
  5. catch(FileNotFoundException ex)
  6. {
  7. //do something here ie report problem to user
  8. }
  9.  
Also I would have reservations about your code functioning at all. I am not sure, but I don't believe a repaint event will occur and you will only see the first and last image as the background image.

Also you should have some sort of timer to dictate how long each image stays on the screen. 30 frames a second is pretty standard.
Jul 9 '10 #2
sword117
35 New Member
@hype261
try
Expand|Select|Wrap|Line Numbers
  1.             {
  2.                 Image[] images = new Image[2003];
  3.                 for (int i = 1; i < 10; i++)
  4.                 {
  5.                     images[i] = Image.FromFile(@"C:\Users\Sword Master\Desktop\New folder (6)\PS3 Background Waves Attempt HD (08-07-2010 23-45-07)\PS3 Background Waves Attempt HD 000" + i + ".jpg");
  6.                     this.BackgroundImage = images[i];
  7.                 }
  8.             }
  9.             catch (Exception f)
  10.             {
  11.                 MessageBox.Show("error {0}", f.StackTrace);
  12.             }
  13.  
you were right xD and thank you for your help =). how do i do that timer to 30 frames per second? i use the timer from toolbox? and use the timer1_tick? =)
Jul 9 '10 #3
hype261
207 New Member
@sword117
Here is the link to MSDN on the Timer class. It will give a more complete explanation than I can give.

http://msdn.microsoft.com/en-us/libr...rms.timer.aspx

btw was I incorrect about the paint event does it display each image as you are cycling through them?

This thread should really be moved to C# programming forum.
Jul 9 '10 #4
sword117
35 New Member
@hype261
no, it only displays the 1º and the last img. you are correct it has to be in form_paint =)
Jul 9 '10 #5
sword117
35 New Member
@hype261
i moved the forum to the c# forum=)
Jul 9 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: David | last post by:
So I'm a new user to Visual Studio .NET. I'm having a problem with an initial setup of a Windows Form Application for a Visual C++ Project. The Windows Form Application (.NET) template is not...
0
by: forge | last post by:
Installing Merge Modules from C# Windows Form Application (not using a setup and deployment project) Hi, Currently, we have an InstallShield project that creates a setup.exe that only...
1
by: Dean R. Henderson | last post by:
I have a Windows library that I bind into a Windows Form application and into an ASP.NET Web Application. I have a procedure in the library that executes a DTS Package. I have also used...
4
by: bob lambert | last post by:
Help I am trying to deploy to another pc a vb.net std 2002 windows form application. I am confused. I created a project - windows form I built form, compiled and debugged. I created a...
3
by: Lucas Tam | last post by:
Hi all, Assuming I've built a windows form application... how do I connect it to a web service? All the examples of web services I've seen pertain to stand alone applications. Basically,...
3
by: Henry Seymour | last post by:
I've developed a .Net Windows Form application and used the Click-Once Deployment. In that application I would like to allow the user a click-once method of uninstalling it. I do not find an...
1
by: Prats | last post by:
I have a windows form application developed in C++/CLR How can I verify that only one instance of the application is running on the user system at any given time. Thanks
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.