Official BS.Player forums  

Go Back   Official BS.Player forums > Main forum > General Talk And Support
Register FAQ Calendar Today's Posts Search

General Talk And Support General talk and peer-to-peer support about BS.Player and other video and audio multimedia players.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 16th June 2005
Junior Member
BS.Player Newbie
 
Join Date: Oct 2004
Posts: 8
Rep Power: 0
salazar is an unknown quantity at this point
Default How to move the movie ???

Which constant can i use to move the movie on the screen ?
What type of parameters to use with the send message : need i to give the top and left corner (as right and botton corner), or is ther a constante to translate the movie ?
Reply With Quote
  #2 (permalink)  
Old 16th June 2005
Moderator
BS.Player Master
 
Join Date: Nov 2003
Location: Italy
Posts: 3,037
Rep Power: 28
Tizio will become famous soon enough
Default

I've tested some of my avi files and I've finded the following:
If you want to know the MovieWindowSize of an .AVI file, you have to read the 32bit value at (decimal)offset 64 for the width, and the 32bit value at (decimal)offset 68 for the height.
NOTE: I can't assure you that all the avi files have the dimension information at that offset, but mine yes!

There is a BEEEEETTER way to retrieve information about avi files, and it's through API calls (here is a VisualBasic example taken from API-Guide that retrieves the AVI file window dimesions):

Code:
Private Const OF_SHARE_DENY_WRITE As Long = &H20
Private Type AVIFileInfo
    dwMaxBytesPerSec As Long
    dwFlags As Long
    dwCaps As Long
    dwStreams As Long
    dwSuggestedBufferSize As Long
    dwWidth As Long
    dwHeight As Long
    dwScale As Long
    dwRate As Long
    dwLength As Long
    dwEditCount As Long
    szFileType As String * 64
End Type
Private Declare Function AVIFileOpen Lib "avifil32" Alias "AVIFileOpenA" (ppfile As Long, ByVal szFile As String, 


ByVal mode As Long, pclsidHandler As Any) As Long
Private Declare Function AVIFileRelease Lib "avifil32" (ByVal pfile As Long) As Long
Private Declare Function AVIFileInfo Lib "avifil32" Alias "AVIFileInfoA" (ByVal pfile As Long, pfi As AVIFileInfo, 

ByVal lSize As Long) As Long
Private Declare Sub AVIFileInit Lib "avifil32" ()
Private Declare Sub AVIFileExit Lib "avifil32" ()
Private Sub Form_Load()
    'KPD-Team 2001
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
    Dim hFile As Long, AviInfo As AVIFileInfo
    'initialize the AVIFile library
    AVIFileInit
    'create a handle to the AVI file
    If AVIFileOpen(hFile, "C:\PATH\file_name.avi", OF_SHARE_DENY_WRITE, ByVal 0&) = 0 Then
        'retrieve the AVI information
        If AVIFileInfo(hFile, AviInfo, Len(AviInfo)) = 0 Then
            MsgBox "AVI dimensions: " + CStr(AviInfo.dwWidth) + "x" + CStr(AviInfo.dwHeight)
        Else
            MsgBox "Error while retrieving AVI information... :("
        End If
        'release the file handle
        AVIFileRelease hFile
    Else
        MsgBox "Error while opening the AVI file... :("
    End If
    'exit the AVIFile library and decrement the reference count for the library
    AVIFileExit
End Sub

Here below is the code (that I made still for Visual Basic) I suggest you to use instead of any SendMessage call to BSplayer (note, the code may be defective, but to me works without problems):

Code:
Const SWP_ASYNCWINDOWPOS As Long = &H4000
Const SWP_DEFERERASE As Long = &H2000
Const SWP_FRAMECHANGED As Long = &H20
Const SWP_DRAWFRAME As Long = SWP_FRAMECHANGED
Const SWP_HIDEWINDOW As Long = &H80
Const SWP_NOACTIVATE As Long = &H10
Const SWP_NOCOPYBITS As Long = &H100
Const SWP_NOMOVE As Long = &H2
Const SWP_NOOWNERZORDER As Long = &H200
Const SWP_NOREDRAW As Long = &H8
Const SWP_NOREPOSITION As Long = SWP_NOOWNERZORDER
Const SWP_NOSENDCHANGING As Long = &H400
Const SWP_NOSIZE As Long = &H1
Const SWP_NOZORDER As Long = &H4
Const SWP_SHOWWINDOW As Long = &H40
Const HWND_BOTTOM As Long = 1
Const HWND_TOP As Long = 0
Const HWND_TOPMOST As Long = -1
Const HWND_NOTOPMOST As Long = -2

Private Declare Sub SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, 

ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)

Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type

Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Dim Rec As RECT
Dim ParentHwnd As Long
Dim AspectRatio As Single

'If you click on Button "Command1"
Private Sub Command1_Click()
    'Retrieve the handle of the MovieWindo
    ParentHwnd = FindWindow("TBSForm", "BForm")
    'If the MovieWindow exists
    If ParentHwnd <> 0 Then
        'Retrieve the MovieWindowSize
        GetWindowRect ParentHwnd, Rec
        'Calculate the AspectRatio of the current MovieWindow
        AspectRatio = Round((Rec.Right - Rec.Left) / (Rec.Bottom - Rec.Top), 3)
        'Resize the MovieWindow
        SetWindowPos ParentHwnd, HWND_TOPMOST, 0, 0, 800, Int(800 / AspectRatio), SWP_NOACTIVATE Or SWP_NOMOVE
        'Get the new MovieWindowSize
        GetWindowRect ParentHwnd, Rec
        'Display the current MovieWindowSize in the caption of the Button         "Command1"
        Command1.Caption = (Rec.Right - Rec.Left) & " x " & (Rec.Bottom - Rec.Top)
    End If
End Sub
This code resize the MovieWindow to have a width of 800pixels (as you asked in previous posts), and the height to the respective aspect-ratio height.
That means that if the movie window was 640x480, after the resizing it will be 800x600!
With this code the movie window will not be moved, if you want also to move the window, you have to delete the Or SWP_NOMOVE string from the SetWindowPos call!

I hope that finally this could help you :D
__________________
BSP SkinMaker (v1.07) the one and only Skin Editor for BSplayer
BSP Definitions Manager (v1.02)
BS.Player's FAQ (by BSPeter) | Italian language file (v2.57 build 1051)
Reply With Quote
  #3 (permalink)  
Old 22nd June 2005
Moderator
BS.Player Master
 
Join Date: Nov 2003
Location: Italy
Posts: 3,037
Rep Power: 28
Tizio will become famous soon enough
Default

Since BSplayer build 818 comes out, MovieWindow name and class changed, so the code has to be modified as follow:
Code:
.....
'If you click on Button "Command1"
Private Sub Command1_Click()
    'Retrieve the handle of the MovieWindo
    ParentHwnd = FindWindow("BSPVideoWindow", "VideoWindow")
    'If the MovieWindow exists
    If ParentHwnd <> 0 Then
.....
__________________
BSP SkinMaker (v1.07) the one and only Skin Editor for BSplayer
BSP Definitions Manager (v1.02)
BS.Player's FAQ (by BSPeter) | Italian language file (v2.57 build 1051)
Reply With Quote
Reply

Tags
move, movie


Posting Rules


All times are GMT +1. The time now is 11:46 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
Ad Management plugin by RedTyger

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20