Skip to main content
RSS feed Subscribe to feed

 

Skip Navigation LinksHome  Extending the Spotfire Platform  Common Tasks and Idioms  Spotfire Data  Setting Binary Values on a DataValueCursor

©Spotfire 2011

Setting Binary Values on a DataValueCursor

A data source or transformation creates binary data by populating a DataValueCursor.

// Create a memory stream to use when converting the image to png.
using (MemoryStream ms = new MemoryStream())
{
	// Convert image to png.
	image.Save(ms, ImageFormat.Png);

	// Reset memory stream to get ready to read binary values.
	ms.Position = 0;

	// Create the BinaryLargeObject from the memory stream and set the binary value.
	binaryCursor.MutableDataValue.Value = BinaryLargeObject.Create(ms);
	binaryCursor.MutableDataValue.IsValid = true;
}