I am trying save an HtmlTextArea as an Image via IronPython.

Greetings! I am trying save an HtmlTextArea as an Image via IronPython. 

I am trying to make this code work, but seems that my TextArea vis parameter can't be casted as TextArea (but as HtmlTextArea).

The .NET code I am trying to convert is:

TextArea textArea = visual.As<TextArea>();

if (textArea != null){

   writer.WriteLine(textArea.GetHtml(delegate(Image image)   

   {

      ExportResultPart png = result.AddPart(new ContentType("image/png")); 

      using (Stream stream = png.GetStream())

      {

         image.Save(stream, ImageFormat.Png); 

      }

      return png.Uri;

   }));

}

More details: http://stn.spotfire.com/stn/Tutorials/HowToCreateExportTool.aspx    

(2) Answers

Login