I made a project that plays a video file inside a panel boundary (w/o any video player apps), using Cheat Engine Lua script + mciSendString winmm.dll, it's work fine. The problem is I want to fit video size to panel size. I have this part of VB script:
Public Function getDefaultSize() As Size
'Returns the default width, height the movie
Dim c_Data As String = Space(128)
mciSendString("where movie source", c_Data, 128, 0)
Dim parts() As String = Split(c_Data, " ")
Return New Size(CInt(parts(2)), CInt(parts(3)))
End Function
and I want ported that script to CE Lua, so far:
function getDefaultSize(Size)
local c_Data = string.rep(" ",128) -- Space(128)
mciSendString("where movie source", c_Data, 128, 0)
--- this part need adapting to Lua
-- Dim parts() = Split(c_Data, " ") --string
-- return New Size(CInt(parts(2)), CInt(parts(3)))
end
Any solutions?
In case the video playing inside a panel boundary (say as panel1) then by ignoring the video aspect ratio, here is the function to fit the video frame to the panel1.
When video start playing:
When change bound of form / panel1:
Meanwhile the problem solved