FishCustard Posted March 14, 2014 Posted March 14, 2014 I'm probably being a numpty here (not helped by the fact that I have a cold and therefore my brain feels like a 486 trying to run Windows 8), but I can't seem to figure out how I can set an icon for a custom tile. The icons all seem to be loaded from an /api/... URL - do I need to add my icons to a config file so that they're served up via the API? When I try putting an absolute URI into the HAP crashes as it's expecting a virtual path in that attribute.
nickbro Posted March 14, 2014 Posted March 14, 2014 Save the image in the images folder, and use ~/images/image.png. The system then processes that image looks for what colour it is, and does some resizing, which is why it references /api/
FishCustard Posted March 17, 2014 Author Posted March 17, 2014 I've done that (PNG image directly in the image folder, referenced as ~/images/imagename.png) but I just get a blank image in the tile. Any ideas? Thanks.
nickbro Posted March 17, 2014 Posted March 17, 2014 None, that should work, can you check the hapConfig.xml has the correct path ~/images/imagename.png
FishCustard Posted March 17, 2014 Author Posted March 17, 2014 Yep, the XML tag is: No dashes, underscores or other oddities in the image name either. Is there a way to point it to an absolute image path as a backup?
nickbro Posted March 17, 2014 Posted March 17, 2014 Ok, that's odd, can you try going to /hap/api/tiles/icons/64/64/images/imagename.png
FishCustard Posted March 17, 2014 Author Posted March 17, 2014 I get a blank image (no ASP.NET error, but just an image file with nothing in) - is there a specific format the images have to be in? The original is the same size as the in-built tiles.
FishCustard Posted March 17, 2014 Author Posted March 17, 2014 Does HAP cache these images at all? If so can the cache be cleared? In the course of testing I tried editing an existing image and the changes didn't seem to show up...!
nickbro Posted March 17, 2014 Posted March 17, 2014 Yes hap does cache them, delete the contents of the icons folder in app_Data 1
FishCustard Posted March 18, 2014 Author Posted March 18, 2014 Aha! Fixed, thank you! I feel rather silly for not noticing a folder called 'iconcache' before now...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now