Retrieve the size of an AVI movie

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

Dim RetString As StringRetString = 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 stringRetString = Left$(RetString, InStr(RetString & vbNullChar, vbNullChar) - 1)' return the information in a zero-based array of stringsDim res() As Stringres() = Split(RetString)' width is in the 3rd element, height is in the 4th elementwidth = CSng(res(2))height = CSng(res(3))

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


The Latest

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS

homes in the real estate industry

Exploring the Latest Tech Trends Impacting the Real Estate Industry

The real estate industry is changing thanks to the newest technological advancements. These new developments — from blockchain and AI to virtual reality and 3D printing — are poised to change how we buy and sell homes. Real estate brokers, buyers, sellers, wholesale real estate professionals, fix and flippers, and beyond may