473,587 Members | 2,321 Online
Bytes | Software Development & Data Engineering Community
+ 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 "FileNotFoundEx ception was unhandled". i need serious help, and if there is a way to use another type of extension(examp le: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 1997
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
1630
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 shown. Any ideas or suggestions of why? I'm pretty sure its not an installation problem because I did a full installation of Visual Studio .Net...
0
2520
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 installs 20 or so merge modules. It does nothing else. We then have our own custom, C# Windows Form application that installs our software applications. ...
1
2190
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 information from Knowledge Base article 306158, INFO: Implementing Impersonation in an ASP.NET Application to create a procedure to perform impersonation. ...
4
7067
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 deployment project (myproj installer) I added my windows app to the installer under myproj installer properties, I set bootstrapper
3
1456
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, what methods are there in VB.NET to connect the various types of applications together? Is there some sort of messaging system?
3
2967
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 uninstall folder for this application. How can I programmatically uninstall the application? Perferred language is Visual Basic.
1
2508
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
7918
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6621
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5713
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3840
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.