get binary data from COM object

H

Henri Schomaecker

Hi folks,

I'm trying to get back jpg binary-data from a COM object, passed as
SafeArray of bytes by the object and print it right to the user agent.

example:
8<--------8<--------8<--------8<--------8<--------

imgObj = win32com.client.Dispatch("mine.imgsender")
myImgData = imgObj.getImgData()
# But myImgData should get it in binary format,
# what it isn't like that.

8<--------8<--------8<--------8<--------8<--------

Unfortunately I'm not familiar enought with python, so I ask you for help.
Note: At the moment, there's no method provided by the COM object which
gives back the size of the image.

I already tried it with...
myImgData = array('B', imgObj.getImgData())
.... but the compiler told me, I couldn't do this.

Every help is greatly appreciated, many thanks in advance,
yours Henri
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top