Jump to content
  • How to read Binary column values and save as images Spotfire® Using IronPython Scripting


    Code example explains on how to read binary column values and save it as image

    Introduction

    This example explains on how to read binary column values and save it as image

    Code Sample

    # Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    from Spotfire.Dxp.Data import *
    from System.IO import *
    from System.Drawing import *
    from System.Drawing.Imaging import *
    
    table=Document.Data.Tables["Data Table"]
    column=table.Columns["Flag"]
    cursor=DataValueCursor.Create[BinaryLargeObject](column); 
    for row in table.GetRows(cursor):
    	value=cursor.CurrentValue
    	stream=value.GetByteStream()
    	img=Image.FromStream(stream)
    	filePath="C:ImagesmyImage" + str(row.Index) + ".Jpeg"
    	img.Save(filePath, ImageFormat.Jpeg)
     

    References

    License: TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...