Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6198497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:02:07+00:00 2026-05-24T04:02:07+00:00

I have json file that I have exported using TexturePacker, and it produces this

  • 0

I have json file that I have exported using TexturePacker, and it produces this format.

{"frames": {

    "But_01_Highlight.png":
    {
        "frame": {"x":0,"y":0,"w":280,"h":41},
        "rotated": false,
        "trimmed": true,
        "spriteSourceSize": {"x":7,"y":8,"w":280,"h":41},
        "sourceSize": {"w":294,"h":57}
    },

I was following a tutorial where you could just turn it into an array but that’s not available on windows phone 7. It feels like I have the reverse engineer every format rather than just read it as is parsed.

How would I create an object with a datacontract to load this format?

My question is also similar to the following question https://stackoverflow.com/questions/3769322/datacontractjsonserializer-with-arbitrary-key-names which has no answer

@Andreas Löw if you could export to a format like so it would be great.

{"frames":[ 
    {
        "filename": "But_01_Highlight.png",
        "frame": {"x":0,"y":0,"w":280,"h":41},
        "rotated": false,
        "trimmed": true,
        "spriteSourceSize": {"x":7,"y":8,"w":280,"h":41},
        "sourceSize": {"w":294,"h":57}
    },
    ...
    ]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:02:08+00:00Added an answer on May 24, 2026 at 4:02 am

    The tool at http://carlosfigueira.me/JsonUtilities/JsonToContract.htm (described in the blog post http://blogs.msdn.com/b/carlosfigueira/archive/2011/01/11/inferring-schemas-for-json.aspx) can be used to create an object graph which can be used to deserialize that JSON using the DataContractJsonSerializer. This is the output of the tool (I had to change the name of the class “But_01_Highlight.png” to “But_01_Highlight_png” because of a bug in the tool).

    Also, this works given that all the JSON data follows the same “schema”. If this is not the case, then the DataContractJsonSerializer is not the best option for that. For WP7, you can use some JSON library such as the classes on the System.Json namespace (you need to add a reference to the System.Json.dll from the Silverlight 3.0 SDK)

    [System.Runtime.Serialization.DataContractAttribute()]
    public partial class FrameClass
    {
    
        [System.Runtime.Serialization.DataMemberAttribute()]
        public int x;
    
        [System.Runtime.Serialization.DataMemberAttribute()]
        public int y;
    
        [System.Runtime.Serialization.DataMemberAttribute()]
        public int w;
    
        [System.Runtime.Serialization.DataMemberAttribute()]
        public int h;
    }
    
    [System.Runtime.Serialization.DataContractAttribute()]
    public partial class SourceSizeClass
    {
    
        [System.Runtime.Serialization.DataMemberAttribute()]
        public int w;
    
        [System.Runtime.Serialization.DataMemberAttribute()]
        public int h;
    }
    
    [System.Runtime.Serialization.DataContractAttribute()]
    public partial class But_01_Highlight_pngClass
    {
    
        [System.Runtime.Serialization.DataMemberAttribute()]
        public FrameClass frame;
    
        [System.Runtime.Serialization.DataMemberAttribute()]
        public bool rotated;
    
        [System.Runtime.Serialization.DataMemberAttribute()]
        public bool trimmed;
    
        [System.Runtime.Serialization.DataMemberAttribute()]
        public FrameClass spriteSourceSize;
    
        [System.Runtime.Serialization.DataMemberAttribute()]
        public SourceSizeClass sourceSize;
    }
    
    [System.Runtime.Serialization.DataContractAttribute()]
    public partial class FramesClass
    {
    
        [System.Runtime.Serialization.DataMemberAttribute(Name = "But_01_Highlight.png")]
        public But_01_Highlight_pngClass But_01_Highlight_png;
    }
    
    [System.Runtime.Serialization.DataContractAttribute()]
    public partial class RootClass
    {
    
        [System.Runtime.Serialization.DataMemberAttribute()]
        public FramesClass frames;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this swf (flash) file that provides the json that needs to be
I have a web service that queries data from this json file, but I
I have an AS 3.0 class that loads a JSON file in using a
I have a Json file that looks like this: [ { field:val }, ....
I have a manifest.json file that looks like this: { name: Zend Debugger Extension,
I have an external JSON file that has this in it: { Home: [
I have a json file that looks like this: { status: 200, data: {
I have a php file somejson.php that echos a json encoded array {jsonone:first json,jsontwo:second
I have a configuration file in the following JSON format: { key1: value1, key2:
I have an external file in php, outputed as json format I want the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.