Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Retrieve the size of an AVI movie

Total Hit ( 2741)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


To retrieve the original size of an AVI file that you've already opened with the mciSendString API function you can use this command

Click here to copy the following block
Dim RetString As String
RetString = Space$(256)
CommandString = "where AVIFile destination"
RetVal = mciSendString(CommandString, RetString, Len(RetString), 0)

Notice that in this case you've to pas a non-null RetString and his length in the second and third parameter respectively. When the function returns, it will contain the four coordinates (X1 Y1 X2 Y2) of the area used by the movie, for instance
  "0 0 320 240"

indicates that the width is 320 and height 240 pixel. To extract this information you must extract the null terminated string out of the buffer, and then parse the result. If you're using VB6 you can write a concise code that does it as follows:
' extract the null-terminated string

Click here to copy the following block
RetString = Left$(RetString, InStr(RetString & vbNullChar, vbNullChar) - 1)
' return the information in a zero-based array of strings
Dim res() As String
res() = Split(RetString)
' width is in the 3rd element, height is in the 4th element
width = CSng(res(2))
height = CSng(res(3))


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.