Jump to content

Help with binary data to image IronPython script


Todd Johnson 2

Recommended Posts

I modified the code in the article below to read data from a BLOB document property but I get an "Invalid Parameter" error at the Image.FromStream(stream) line.

The BLOB in question is a Bitmap saved as PNG image type that is written to the document property by a similar IronPython script. The image is correctly rendered as a label in a text area.

https://community.spotfire.com/s/article/How-to-read-Binary-column-values-and-save-as-images-TIBCO-Spotfire-Using-IronPython-Scripting

from Spotfire.Dxp.Data import *

from System.IO import *

from System.Drawing import *

from System.Drawing.Imaging import *

blob = Document.Properties["myImage"]

stream=blob.GetByteStream()

img=Image.FromStream(stream)

#img=Image.FromStream(stream,0,1)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...