I'm making a COM call that should return a two dimensional array, but  
instead I get back a buffer that appears to only contain a single row  
from the array.

Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit  
(Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import win32com.client
 >>> mi=win32com.client.Dispatch("MIDLIBCom.MIDLib")
 >>> cams=mi.OpenCameras("C:\Program Files\Micron Imaging\sensor_data")
 >>> c=cams[0]
 >>> c.startTransport()
 >>> c.updateFrameSize(c.sensor.width, c.sensor.height, 8,0)
 >>> f=c.grabFrame()

At this point f should be a 2048 by 1536 array of bytes, but instead...

 >>> len(f)
2048
 >>> type(f)
<type 'buffer'>

I know the COM library is returning the right data because if I do a  
similar trick with IronPython...

IronPython 1.1 (1.1) on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
 >>> import clr
 >>> clr.AddReferenceToFile("MIDLIBCOMLib.dll")
 >>> import MIDLIBCOMLib
 >>> mi=MIDLIBCOMLib.MIDLibClass()
 >>> cams=mi.OpenCameras("C:\Program Files\Micron Imaging\sensor_data")
 >>> c=cams[0]
 >>> c.startTransport()
 >>> c.updateFrameSize(c.sensor.width, c.sensor.height, 8,0)
 >>> f=c.grabFrame()
 >>> len(f)
3145728
 >>> type(f)
<type 'Array[Byte]'>
 >>>

Its been squashed down to a 1 dimensional array, but at least all the  
data is there.
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to