Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jul 2014

    Generating Transparent Tiles as PNGs in Background Agent - Memory Contraints

    Hi Have an app that generate a custom tile in the background agent. Currently as a JPG but for WP8.1 I need to generate as a PNG to allow it be to transparent.

    But... have not yet managed to do this without memory issues. When creating a JPG used about 8M memory, but the same code but altered to create a PNG (using ToolstackPNGWriter) goes to 15M. Not even close to the 11M maximum allowed.

    Just wondering what others have done/are using to achieve this.
    Or maybe I'm doing something wrong in how I call the PNGWriter.

    - thanks

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Oslo, Norway

    Re: Generating Transparent Tiles as PNGs in Background Agent - Memory Contraints

    Are you using images with proper resolution? Based on the tile sizes on http://msdn.microsoft.com/en-us/libr...v=vs.105).aspx, a 32-bit RGBA, uncompressed set would be (691x336 + 336x336 + 159x159)*4=1481412 bytes. So even if you generate images for all 3 tile sizes, and do not compress them all, that would consume around 1.5 megabytes of memory.

  3. #3
    Super Contributor
    Join Date
    Feb 2013
    Dublin, Ireland

    Re: Generating Transparent Tiles as PNGs in Background Agent - Memory Contraints

    Also, what is the code doing, can you give an overview of how you're generating images?

    If you do too much work or processing before the image generations, you can run out of memory. It's always best to clean up as you go along ie. set properties to Null, use GC.

Similar Threads

  1. Use MixRadio API in background task (scheduled agent)
    By sebfrie in forum Nokia MixRadio Windows Phone API
    Replies: 4
    Last Post: 2014-02-21, 21:55
  2. Push notifications to background application(Agent) How ?
    By mIIsko in forum Windows Phone General
    Replies: 5
    Last Post: 2014-01-28, 16:41
  3. Heads up, don't use transparent pngs as icons / screenshots
    By grekker in forum [Closed] Publishing to Nokia Store
    Replies: 5
    Last Post: 2010-12-04, 01:37
  4. PNGs with semi-transparent pixels
    By ehudshapira in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2007-12-29, 23:50
  5. Agent appplication with should run in background
    By alonish in forum Mobile Java General
    Replies: 8
    Last Post: 2007-01-08, 15:50

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts