export image to server

2 posts, 0 answers
  1. Andrea
    Andrea avatar
    9 posts
    Member since:
    Jul 2010

    Posted 13 Dec 2011 Link to this post

    Hi ,
     I am succesfully using your

    Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage
    to save on teh client machine a FrameworkElement.

    Now I would like to send this image also to the server
    To do so my idea is to cerate a new MemoryStream :
    var stream = new MemoryStream();

    Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage( element, stream,new PngBitmapEncoder())

    and then put the memoryStream to a string and send teh string to the server using

    WebClient.UploadStringAsync

    the problem I have in this solution is that the MemoryStream returned by the ExportToImage is very short (81 bytes)  while I expect an image of around 24kb

    have you faced this probolem before? do you have a solution?

     

     

     

     

     

     

     

  2. Bartholomeo Rocca
    Bartholomeo Rocca avatar
    247 posts
    Member since:
    May 2006

    Posted 15 Dec 2011 Link to this post

    Hello Andrea,

    I have encountered something similar in one of my projects -- basically stream with length 81 bytes means that that the exported image is empty.
    The problem in my application was related to the fact that I was trying to export chart instance that was not part of the visual tree (it was virtualized ListBox content) and this is not supported by the export-to-image functionality in Silverlight.


    Greetings,
    Bart.
Back to Top