{ "id": "77426", "key": "TIMOB-4596", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11364", "description": "Mobile 1.8.0 M11", "name": "Sprint 2011-32", "archived": true, "released": true, "releaseDate": "2011-08-15" } ], "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2011-08-02T15:22:10.000+0000", "created": "2011-07-05T16:43:38.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "11367", "description": "", "name": "Release 1.7.1", "archived": true, "released": true, "releaseDate": "2011-06-21" } ], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-03T22:30:20.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "* We want to *re-size* an image to map components to certain coordinates in the _ImageView_.\r\n\r\n* Get the *+height+* and *+width+* properties of the _resized_ image.\r\n\r\n{code:title=app.js|borderStyle=solid}\r\n\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor:'blue'\r\n});\r\n\r\nvar image = Titanium.UI.createImageView({\r\n\timage:'http://lh5.ggpht.com/-J7Q7cUDEFOU/S_bKEoyMSzI/AAAAAAAAGIw/PZJduitsVa0/largeNewGoogleLogoFinalFlat-a.png',\r\n\theight: 'auto'\r\n});\r\nimage.addEventListener('load', function(){\r\n\tvar img = image.toImage();\r\n\talert(\"Width: \"+ img.width + \" / Height: \" + img.height);\r\n});\r\n\r\nTitanium.Gesture.addEventListener('orientationchange', function(e) {\r\n\talert(\"Orientation: \" + e.orientation);\r\n\t\r\n\tvar img2 = image.toImage();\r\n\talert(\"Width: \"+ img2.width + \" / Height: \" + img2.height);\r\n});\r\n\r\nwin.add(image);\r\nwin.open();\r\n{code} \r\n\r\n - *toBlob() :* gives us the _source_ image's dimensions. \r\n - *toImage() :* gives us the _width_ and _height_ of the image display it.\r\n\r\n{quote}\r\nh3. Associated Helpdesk Ticket\r\n\r\nhttp://support.appcelerator.com/tickets/APP-238573\r\n{quote}", "attachment": [], "flagged": false, "summary": "iPad: Resized image of ImageView", "creator": { "name": "mvizcaino", "key": "mvizcaino", "displayName": "Miguel Vizcaino", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mvizcaino", "key": "mvizcaino", "displayName": "Miguel Vizcaino", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "h3. iOS 4.3", "comment": { "comments": [ { "id": "161569", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm not exactly following. This sounds more like we need better documentation on blob handling to stop the imageView abuse antipattern.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-08-02T15:22:10.000+0000", "updated": "2011-08-02T15:22:10.000+0000" }, { "id": "408978", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing as duplicate.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-03T22:30:20.000+0000", "updated": "2017-03-03T22:30:20.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }