Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, August 24, 2005 9:36:28 AM(UTC)

wes  
wes

Groups: Registered
Posts: 2


I am having issues with the byte array source on the play control, everytime I try to assign it using the following code it starts for crash and will not run correctly.  Please let me know if there is an issue with this or supply a proper example of source array or source stream..  I have made a project that just loads the file and plays the control to make sure there was no other code interfering.

 

'filebytearray example

Dim o As System.IO.FileStream
o = New FileStream("C:\2005_8_22.avi", FileMode.Open, FileAccess.Read, FileShare.Read)
ReDim FileByteArray(o.Length)
o.Read(FileByteArray, 0, o.Length)

AxltmmPlayCtrl1.SourceArray = FileByteArray

'source stream example

'Dim rrr As StreamReader
'rrr = New StreamReader(o)

'AxltmmPlayCtrl1.sourcestream = rrr

o.Close()

 

Thanks  [:S]

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, August 29, 2005 10:49:52 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 367

Was thanked: 1 time(s) in 1 post(s)

You cannot use a managed .NET array with the OCX SourceArray property.
The code below transfers the data from the managed array to a Win32 global memory handle that can be used with the multimedia OCX.
First, add this to the top of the VB file:
Imports System.Runtime.InteropServices

Dim o As System.IO.FileStream
o = New FileStream(SourceFileName, FileMode.Open, FileAccess.Read, FileShare.Read)
ReDim FileByteArray(o.Length)
o.Read(FileByteArray, 0, o.Length)
o.Close()
Dim Ptr As IntPtr
Ptr = Marshal.AllocHGlobal(FileByteArray.Length())
Marshal.Copy(FileByteArray, 0, Ptr, FileByteArray.Length())
'Remove this: AxltmmPlayCtrl1.SourceArray = FileByteArray
AxltmmPlayCtrl1.SourceHGlobal = Ptr.ToInt32()
AxltmmPlayCtrl1.Run()
MsgBox("wait")
AxltmmPlayCtrl1.ResetSource()
Marshal.FreeHGlobal(Ptr)

Amin Dodin

LEADTOOLS Technical Support
Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.073 seconds.