Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Video with annoying frame

Status
Not open for further replies.

SitesMasstec

Technical User
Sep 26, 2010
502
BR
Hello colleagues!

I have a video which plays well in the Windows Media Player. This is the first screen:
VideoWindowsMPlayer_vgkjve.jpg


In a VFP 9 application, I have a player (MCI Player) inside a form, which plays the same video above, BUT it appears with a large right and bottom frame when played:
VideoInsideVFP9App_c2ggyk.jpg


How to avoid the frame inside application, which cuts part of the video?


Thank you,
SitesMasstec
 
I changed 'player' with 'cFileName' in the commands, but I got error:

Code:
*!* Once we have the window handle, we need to position
		*!* the video window to be the same position and size
		*!* as our player rectangle on the form
		x1Pos = THISFORM.player.LEFT
		y1Pos = THISFORM.player.TOP
		x2Pos = THISFORM.cFileName.width
		y2pos = THISFORM.cFileName.height

		*!* Use the SetWindowPos Windows function to set position and size
		setWindowPos(hWin,0,x1Pos,y1Pos,x2Pos,y2Pos,0)

Thank you,
SitesMasstec
 
On your early screenshot the control had a style property - I don't have it so I can't say
what the options are.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

There is no place like G28 X0 Y0 Z0
 
Which of the about 2000 errors did you get and at which line?

One thing about the mci commands is that you have to do things in order. One of the mci commands is there to load the media and give it a name for all further mci commands.
If you don't understand what youre dealing with, what has to be taken over into your own form and what needs to initialize how and when, you can get all kinds of errors regarding wrong media name reference, wrong hWin window handle, because all these things depend on each other.

I don't know what to fix from all your posts so far. I saw the phenomenon, that already tells a lot of details, like you got the file loaded and playing, just in the wrong position and size. Everything points to the SetWindowPos call that needs other parameter values. The right top/left and width/height, and regarding vernspaces input, maybe also one of the flags.

You said moving the window when paused helped, So what if you don't move the form but move the video window? Your video displays too far left and too high, so you need higher left and top values, then vary your SetWindowPos and see what it does when you change parameters.

Chriss
 
Griff:

Yes, but the Style can be set to 0-Normal (Default) or 3-Themed. I changed to Themed, but it presented the same problem (right and bottom black margins)



Thank you,
SitesMasstec
 
Let me try with concrete questions:

Do you see a difference, if instead of doing setWindowPos(hWin,0,x1Pos,y1Pos,x2Pos,y2Pos,0) you do
Code:
setWindowPos(hWin,0,x1Pos+100,y1Pos+100,x2Pos,y2Pos,0)
If not, then you likely have the wrong hwin. Or you edit the wrong form. I'd not go that far, but it has happened to experts too, that changing code had no effect.

The video showing up and playing at whatever position and size tells you there is no real mci problem, but you're doing something wrong. Determining the hwin takes an MCI command. There can be many reasons why that's wrong. You don't show much code, so it's quite impossible to guide you through this.

If, on the other hand, this at least moves the video to a better position, then you're already closer to what the parameters need to be.

The other thing is: Did this example work for you?

Chriss
 
Chris:

The video box changed the position but the video itself was mainly outside the video box:
WhatsApp_Image_2022-06-08_at_15.09.28_bdh00r.jpg



Thank you,
SitesMasstec
 
Okay, that's one stepp forward, you have the right hWin handle.

Now it looks though you made the window larger the upper left portion showing the video became even smaller. How about makeing the window smaller?
Code:
setWindowPos(hWin,0,x1Pos,y1Pos,x2Pos-200,y2Pos-200,0)

Does it at least reduce the black?

I think vernspace has the right idea about what's missing: The scaling isn't working, the video isn't stretched to the window size, and that might work with his idea of an MCI command about stretching. Look back to his post.


Chriss
 
Chris:

I have changed a lot of x1,y1,x2,y2 values, with no solution.

Please note that the original mci_play.scx/scf form works CORRECTLY if I open the fox.avi video provided in the Samples, Solution.
The problem occurs if I load a MPG file.

I have not found the Stretch property, as Vernspace had advised me in a later post.



Thank you,
SitesMasstec
 
It's not a property, follow the link:
So the Mci command string has to be "window FoxMedia overlay stretch", I think, so

Code:
THISFORM.doMCI("window FoxMedia overlay stretch") before the SetWindowPos

Btw. I don't know what you changed in your own version of the mciplay.scx. I have understood and read that your video didn't work in there and you had the original unchanged MCI_play.scx.
But I don't have hands on your compuer and you give sparse feedback. So we have to crawl to the solution.

There can settings on your system about graphics card and codes that change the behaviour of your computer only.
You only get to a solution if you ty different things and not by insisting it must work.

And if you didn't get vernspace's recommendation then ask back. We can't know you don't understand something unless you tell it. I don't know if this is a cultural thing for you or language barrier. But when you don't have a problem with asking for tips, then why do you have problems asking about details of a recommendation you don't get?


Chriss
 
Chris:

I will study mci more deeply these days and try to solve the problem by reading again the advices in the posts here.
As soon as I solve the problem I will post the result here.
Thank you very much.


Thank you,
SitesMasstec
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top