Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

WriteableBitmap security issue FIXED! RSS

7 replies

Last post Jul 11, 2009 06:01 PM by dcssys

(0)
  • ksleung

    ksleung

    Contributor

    6680 Points

    1265 Posts

    WriteableBitmap security issue FIXED!

    Jul 09, 2009 08:26 PM | LINK

    I have confirmed that the WriteableBitmap security issue has been fixed!  Thank you, SL team!

    I wrote a small app to test it.  I can now access the bits of a WriteableBitmap after Render() -- from an image that I have full rights to.  Even better, I have access to the pixel array in the form of int[] rather than calling the per-pixel operator[] API.  This is great!  The SL team has really listened to our feedback, and a big thanks from me.

    The exact detail about the security policy -- if any -- would come later, I guess, since I can't find any information.

    Visit http://www.tagxedo.com, a Silverlight-based word cloud generator. If you like it, please help me spread the word!
  • jay nanavati

    jay nanavati

    Contributor

    3517 Points

    668 Posts

    Re: WriteableBitmap security issue FIXED!

    Jul 09, 2009 09:43 PM | LINK

     It means we can print screen of Silverlight app? Or I am wrong?

  • ksleung

    ksleung

    Contributor

    6680 Points

    1265 Posts

    Re: WriteableBitmap security issue FIXED!

    Jul 09, 2009 09:46 PM | LINK

    Doesn't mean that.  Still no printing.
    Visit http://www.tagxedo.com, a Silverlight-based word cloud generator. If you like it, please help me spread the word!
  • jay nanavati

    jay nanavati

    Contributor

    3517 Points

    668 Posts

    Re: Re: WriteableBitmap security issue FIXED!

    Jul 09, 2009 09:54 PM | LINK

    No, I mean can we allow user to save WriteableBitmap image as jpg or bmp image format?

  • ksleung

    ksleung

    Contributor

    6680 Points

    1265 Posts

    Re: Re: WriteableBitmap security issue FIXED!

    Jul 09, 2009 10:11 PM | LINK

    Yes, with an asterisk *

    * If indeed the security criteria is satisfied, you can access the bits of the bitmap after calling Render().  Then, you can convert the bits into Jpg, Bmp, or Png format.  SL3 does not provide any encoder.  However, it is pretty easy to find or port them.  Also, encoding is significantly easier than decoding, so either something already exists, or you will find one in Codeplex soon (or you can author one).  If you need it now, you can also use FJCore which both encodes and decodes Jpg.

    However, this would not be a general-purpose printing substitute because not all controls will pass the security criteria.  An example, I was told, is a cross-domain image.

    Visit http://www.tagxedo.com, a Silverlight-based word cloud generator. If you like it, please help me spread the word!
  • Brauliod

    Brauliod

    Contributor

    2392 Points

    736 Posts

    Re: Re: Re: WriteableBitmap security issue FIXED!

    Jul 11, 2009 12:26 AM | LINK

    Thanks,

     Quite interesting, are you going to post some sample in your blog?

     A pity that SL does not include the JPEG encoder / decoder.

     Thanks

       Braulio

  • ksleung

    ksleung

    Contributor

    6680 Points

    1265 Posts

    Re: Re: Re: WriteableBitmap security issue FIXED!

    Jul 11, 2009 03:39 AM | LINK

    Looks like we are talking about the same topic on two different channels :D

    Anyway, here's the link to the other threads for other readers http://silverlight.net/forums/t/105680.aspx

    I actually think that Jpeg encoder should not be part of the runtime since it makes it bigger for little gain.  For those who need it, it is available.  SL supports Jpg decoding (obviously) and with WriteableBitmap and the Render() method and the security fix, you can get the content of a Jpg.  Only thing is that the EXIF data is lost.  Well, this can also be fixed with a separate EXIF parser module, which I also think should not be part of the runtime.

    Visit http://www.tagxedo.com, a Silverlight-based word cloud generator. If you like it, please help me spread the word!
  • dcssys

    dcssys

    Member

    39 Points

    40 Posts

    Re: Re: Re: WriteableBitmap security issue FIXED!

    Jul 11, 2009 06:01 PM | LINK

    Maybe this will help :)

     http://silverlight.net/forums/p/108713/247204.aspx