Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Embed and play an AVI file

Embed and play an AVI file

Scheduled Pinned Locked Moved C#
helpgraphicstutorialannouncementlearning
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    smithriver
    wrote on last edited by
    #1

    I have a process that can take over ten minutes to complete. So, I added an update dialog box with an axAnimation (axMSComCtl2) control. I update a label as the little wheels spin in the AVI. Works great (using an explicit path in the Open method)! Here's the current code that works: string sAppPath = Path.GetDirectoryName(Application.ExecutablePath); string sAviFile = sAppPath + "\\PleaseWait.avi"; axPleaseWait.Open( sAviFile ); axPleaseWait.Play(0, 0, 0); The problem is the file distribution. I have been asked by the powers that be to embed the AVI file in the project. I have found two ways to embed an AVI file: 1) right-click on the project, select "Add existing item", then browse to and select the AVI file (found by trial & error); 2) create a resource file, add the AVI, and then add the .resource file to the project (found in the MSDN). But I have yet to figure out how to get either of these methods to work! The problem with the first method is that I have no way to get a path to the AVI file listed in the Solution Explorer. I thought about writing it to a temp file, but I have not figured out how to read in the AVI file. (I think this would be the most straight foward method to use). The problem with the second method is that the resource file will not let me explicitly state that this is an AVI file. So, I selected Bitmap. I don't even know if the AVI has been added to the .resource correctly. Likewise, I have not figured out how to get the AVI file back out of the .resource file. Any help would be greatly appreciated. Thanks!

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups