[TIMOB-4596] iPad: Resized image of ImageView
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Needs more info |
Resolution Date | 2011-08-02T15:22:10.000+0000 |
Affected Version/s | Release 1.7.1 |
Fix Version/s | Sprint 2011-32 |
Components | iOS |
Labels | n/a |
Reporter | Miguel Vizcaino |
Assignee | Blain Hamon |
Created | 2011-07-05T16:43:38.000+0000 |
Updated | 2017-03-03T22:30:20.000+0000 |
Description
* We want to *re-size* an image to map components to certain coordinates in the _ImageView_.
* Get the *+height+* and *+width+* properties of the _resized_ image.
var win = Ti.UI.createWindow({
backgroundColor:'blue'
});
var image = Titanium.UI.createImageView({
image:'http://lh5.ggpht.com/-J7Q7cUDEFOU/S_bKEoyMSzI/AAAAAAAAGIw/PZJduitsVa0/largeNewGoogleLogoFinalFlat-a.png',
height: 'auto'
});
image.addEventListener('load', function(){
var img = image.toImage();
alert("Width: "+ img.width + " / Height: " + img.height);
});
Titanium.Gesture.addEventListener('orientationchange', function(e) {
alert("Orientation: " + e.orientation);
var img2 = image.toImage();
alert("Width: "+ img2.width + " / Height: " + img2.height);
});
win.add(image);
win.open();
- *toBlob() :* gives us the _source_ image's dimensions.
- *toImage() :* gives us the _width_ and _height_ of the image display it.
{quote}
I'm not exactly following. This sounds more like we need better documentation on blob handling to stop the imageView abuse antipattern.
Closing as duplicate.