Preview of Resolution Independent Control library for RevMobile

Monte Goulding monte at sweattechnologies.com
Sun Jul 29 19:13:14 EDT 2012


> I haven't said much in this discussion because it's all such a mess I don't know where to start. But to be honest, I agree that scaling would be better in general than sets of presized images, since as you say, they'd all need scaling anyway on some devices.

Good point. I'll try to clarify my thoughts and perhaps start a new thread with a more appropriate subject.
> 
> But if someone does want to implement separate image sets, I think it could be done with what we have now, without needing an extra engine property. I even started down that road on my current mobile project, but gave it up because it was just too fiddly and unreliable.

I agree. The simplest way to handle this would be a library function. I rarely rely on the current directory being what it should be. I know I always reset it to the original after changing it for whatever reason but relying on everybody doing that seems a risk. I generally do something like the following because it works in development and standalone:

put the effective filename of this stack into tPath
set the itemDel to "/"
put "images/myimage.jpg" into item -1 of tPath

Now it would be really easy to write a function that returned a full image path given a relative path from the image folder. Assuming we know what density range we are running at we could easily add in the extra folder. Then what happens if the image isn't there. In java on android it searches up the density ranges for an image to scale down. If it doesn't find one it searches down for one to scale up. If we did that we would need to either scale the image before returning the path or return it with a scale difference from the environment. That all sounds complicated so it might be better to either not support that or just go with the live scaling thing.

Cheers

--
M E R Goulding 
Software development services
Bespoke application development for vertical markets

mergExt - There's an external for that!




More information about the use-livecode mailing list