[TIMOB-7056] TiMob: imageView - support a base64 string as a valid image in the image property
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | TiAPI |
Labels | n/a |
Reporter | Matthew Apperson |
Assignee | Ingo Muschenetz |
Created | 2012-01-10T08:00:50.000+0000 |
Updated | 2015-04-13T20:12:32.000+0000 |
Description
Doing this will allow devs to share/re-use commonJS modules that need graphics (like for custom UI elements) without worrying about image file paths or if all the images were copied over to the new project.
Based on my research, this should be able to be done in under 5 lines of code.
var win = Ti.UI.createWindow();
var image = Ti.UI.creteImageView({
width:100,
height:100,
image: 'R0lGODlhMAAwAPf/ANfJuKldI7SgkJNOGoFDFsp1KsFuJNuCLtKCO/elPdF9M66HZ8x6M86YZuOL
M8VwJd2KPIZ2adaldpybm3M7E31BFZRSIqOjo+OVRLBqNsl9QaxgJPm8Wry8vHpzbfzDXMVyLGNZ
U4NFGMLCwlZMJum1dapcHltQR/KtVNyMQblyO9qEM9HR0dTOxeWRPGk1EMp0JvGcOvSsTlstDfzJ
ZOycQ+yjTuHCmmUzEE84KP7DU6plMvWxVKRZHvKiQmIyD3dhUrhmIrOzs6NyTa2tremUO6KTiaJc
KYWEhPu7UfW0WdOEQc13KrRmKfe9YbBiH3g/FZVQHeKNOtfSyuyUNqFZJcV0ML5tLVIpDNqGOs3N
zaVdKNB5KKFXHfyyRKZcJaJYIaVgLblpKrVtOMnJyUgkC2NVKZ5VHdmuhplSHcl6O9aYVZJuV41M
Hv28Te6ZO+6oU3VnNYNaKt+RQ7itpZ1YJplSGrloIZlWJda/qKVaIahhLplUIZxWIuSpam44EbBi
Jfa5Xsh2MbxwNOmdSv66RolIGcFuKb1sKsB2PdR9Kv7JW4lKHbVlIrVoKuCHL+WbS+2zafqzS45K
GLBhIrxpIr1qJa1hKNSANPayToRLG+ylUp1aKf7BTfapRbhtM7poJZSUlItJF69mLrVlJr9sI6Ji
I/m3VDojE/m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ShCtK5zhS4ABur
RJMK7lAJqxzCAJaIRyMosQGOmgoMYPCYBfqwhaYd4Rfk6+NC1cnOZRQBngcRgDZmGoSaViIIlLBX
OLpwho+lIQ0mO1rT8DDMcw5ipfBAQCoJISuDsGAI9rrRjXphL56a7KdRAJgFdtGGodZBH79oxhgG
kYgZZgEC7FBZQs5xhAHYgRd26IIJutAFXpRsAAMIhigM0QZGtOGvcrMAJ44wiwzE0KxFaEAzE2IE
UThWFJOwQ3bsEIVgTOIb/1IVv77hDqUJdpjN8MUgGIAJKVhjQwnRljpc9SoR4IcA2ciGCAjgqmn/
sYoRFmBEZy2gD2MMwxFWYMAtUnCmxR6EBVoggwfG9AdD/YG5zx2ToaBAW0aIALfewMMWLuELK6wg
CxfQgk0UwgIWTAMXHngBDn7wA/X+4QXwje6YXsWqkUWhD5doAiLm4YwJTIMMxkUIckdwDiTkAAvd
SbCP4PuC6EKBVSIoWTECAAoYDOECHRiBFgJ8XPN2gAj0CAEqyoAFBHfnB+tt73MfPIlJpKEHvdhB
BC4gBFwA2CHIncY5iHABJJwAFf0osYnX66PmQiGyvOBGBEJB4w4AmMOp1cI0PnyBCSAhBDmQRhnK
0J34UoBV6wBCBLYxgQucw8nljUiORyAEHk8gNBRI8EAITkBnOgPBAx7YBj0ucAEiZPjJEymvlDvQ
ZiKUeQKITjSi+UwEIZxjBGTYMJQHEhAAOw=='
});
win.add(image);
win.open();
It would be great if this worked on background images to for all views... would you like me to make another ticket for that?