This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, August 24, 2005 9:36:28 AM(UTC)
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]
#2
Posted
:
Monday, August 29, 2005 10:49:52 AM(UTC)
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 LEAD Logo](https://www.leadtools.com/images/new-site-images/leadtools-logo-header.png)
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.