Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filling with background with image gives json error #162

Open
Ronnin2011 opened this issue Jan 5, 2025 · 3 comments
Open

Filling with background with image gives json error #162

Ronnin2011 opened this issue Jan 5, 2025 · 3 comments

Comments

@Ronnin2011
Copy link

Ronnin2011 commented Jan 5, 2025

Trying to set an image as a background using the provided code from the tutorial, gives a json data error..

This is the provided code example:

"Fill:= ImageBrush Stretch="UniformToFill" ImageSource="" "
(i removed the </> cause for some odd reason it wont show the whole line of code here)

And this is my code:

"controlStyles[0].target": "Rectangle#BackgroundFill",
"controlStyles[0].styles[0]": "Fill:=<ImageBrush Stretch"UniformToFill" ImageSource"C:\taskbar\win8.PNG" />",

what am I doing wrong?
Happy new year btw!

@m417z
Copy link
Member

m417z commented Jan 5, 2025

Quotes and backslashes have to be escaped in JSON, for example:

{
  "controlStyles[0].target": "Rectangle#BackgroundFill",
  "controlStyles[0].styles[0]": "Fill:=<ImageBrush Stretch=\"UniformToFill\" ImageSource=\"C:\\taskbar\\win8.PNG\" />"
}

Generally, the JSON wasn't designed to be modified by hand. It was designed to backup and share mod settings. Why not use the settings UI instead?

@Ronnin2011
Copy link
Author

Ronnin2011 commented Jan 5, 2025

I tried with the backslashes as well, but to no avail..
Anyway, I guess I was so dragged into finding what is wrong with it, that i totally forgot to test it through the settings..
Thanks for reminding me!
BTW Does the image have to be a certain pixel number on height and width? Cause it ain't reading/applying mine..

@SandTechStuff
Copy link

@Ronnin2011

BTW Does the image have to be a certain pixel number on height and width? Cause it ain't reading/applying mine..

I do not think so, what image are you using? I can test it myself if you would like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants