Screen capture on Windows Phone 7

Survivalcraft is still in certification and sources say it may take up to several days. Nothing I can do to speed it up. In the meantime I started working on the first update. First thing I want to add is an ability to create screenshots and save them to your media library. Sounds simple?

It turns out it is anything but. Windows Phone 7 API is still quite new and has a fair share of bugs and omissions (am I trying to excuse Microsoft?). One that really annoyed me yesterday is a memory leak in the XNA jpeg encoder. Apparently, the same leak exists in Windows, but hardly anyone noticed because you have heaps of memory there. Not so on the phone.

Anyway, with every encoded jpeg you lose about a megabyte of memory. That means you cannot use it for saving screenshots to media library, period. The only alternative is to roll out your own jpeg encoder. How crazy is that? Obviously, jpeg encoding written in verifiable managed code and running on 1GHz in-order architecture is quite slow.

Apparently this bug has been sitting in MS bugs database for almost a year now, but they are just ignoring it.

But I still got it working in the end :-)

3 Comments

  1. zxcvbad
    Posted November 14, 2011 at 18:43 | Permalink | Reply

    Hello, genius boy :)

  2. Posted July 24, 2013 at 05:19 | Permalink | Reply

    Second

    • Posted December 10, 2014 at 00:43 | Permalink | Reply

      Who cares if they’re first, second, third, etc? You do, and you shouldn’t. If I was the first commenter, then I would say my own stuff like “You should add cameras and multiplayer.” So saying “second” is a total WASTE OF TIME!!!

Leave a Reply. No swearing please.

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s