PDA

View Full Version : Setting an Image Source



DonRul
28 Mar 2012, 4:15 PM
I have code that was working well with this statement:

img.setSrc("data:image/png;base64," + base64.encode(me.shippingConfirmation.data.ShippingLabel));
And it suddenly stopped working complaining that base64 doesn't exist

After searching around I found this alternative syntax

[img.setSrc("data:image/png;base64," + Ext.util.base64.encode(me.shippingConfirmation.data.ShippingLabel));

It does not fail but the image does not show. I know that the data is good and when I look at img the _src has reasonable looking data in it.

The actual size of the png that is getting loaded is larger than the window available for it but it has just been cropped before.

Designer 2 Build 341
Library: http://extjs.cachefly.net/touch/sencha-touch-designer-edition/

Any ideas?
Thanks