Hello,

I am expecting a 720x480 array (safearray, 1 byte/pixel) from the method
below from a camera SDK but win32com is returning a byte buffer of size
720. Extracting the data from the buffer I can get pixel values of only 1
row of pixels and not the entire 2D array. How can I get the 2D array?

I've seen posts on relatively similar topics but couldn't solve the problem.

Thank you for any help that you can provide.

Regards,

Filippo




Python 2.7.6, pywin32 (220)

>>> import win32com.client
>>> import struct
>>> cam=win32com.client.Dispatch(AA)
>>> a=cam.GetRawData()
>>> a
<read-write buffer ptr 0x0000000002D19738, size 720 at 0x0000000002D19700>
>>> len(a)
720
>>> a[0]
'\x12'
>>> struct.unpack('b', a[0])
(18,)
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to