get binary data from COM object

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Henri Schomaecker

    #1

    get binary data from COM object

    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.getImgDa ta()
    # 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.getImgDa ta())
    .... but the compiler told me, I couldn't do this.

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

    --
    | Henri Schomäcker - BYTECONCEPTS, VIRTUAL HOMES
    |     Datendesign für Internet und Intranet
    |         http://www.byteconcepts.de
    |         http://www.virtual-homes.de
Working...