{"action":"created","issue":{"url":"https://api.github.com/repos/cocos-creator-packages/jsb-adapter/issues/61","repository_url":"https://api.github.com/repos/cocos-creator-packages/jsb-adapter","labels_url":"https://api.github.com/repos/cocos-creator-packages/jsb-adapter/issues/61/labels{/name}","comments_url":"https://api.github.com/repos/cocos-creator-packages/jsb-adapter/issues/61/comments","events_url":"https://api.github.com/repos/cocos-creator-packages/jsb-adapter/issues/61/events","html_url":"https://github.com/cocos-creator-packages/jsb-adapter/pull/61","id":373315467,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1MjcyNzQ0","number":61,"title":"improve contet2D create/get/put ImageData method","user":{"login":"drelaptop","id":26329291,"node_id":"MDQ6VXNlcjI2MzI5Mjkx","avatar_url":"https://avatars3.githubusercontent.com/u/26329291?v=4","gravatar_id":"","url":"https://api.github.com/users/drelaptop","html_url":"https://github.com/drelaptop","followers_url":"https://api.github.com/users/drelaptop/followers","following_url":"https://api.github.com/users/drelaptop/following{/other_user}","gists_url":"https://api.github.com/users/drelaptop/gists{/gist_id}","starred_url":"https://api.github.com/users/drelaptop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drelaptop/subscriptions","organizations_url":"https://api.github.com/users/drelaptop/orgs","repos_url":"https://api.github.com/users/drelaptop/repos","events_url":"https://api.github.com/users/drelaptop/events{/privacy}","received_events_url":"https://api.github.com/users/drelaptop/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-24T05:50:56Z","updated_at":"2018-10-24T05:54:35Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/cocos-creator-packages/jsb-adapter/pulls/61","html_url":"https://github.com/cocos-creator-packages/jsb-adapter/pull/61","diff_url":"https://github.com/cocos-creator-packages/jsb-adapter/pull/61.diff","patch_url":"https://github.com/cocos-creator-packages/jsb-adapter/pull/61.patch"},"body":"在基础上完善：https://github.com/cocos-creator-packages/jsb-adapter/pull/55\r\n\r\n- 测试\r\n\r\n```JavaScript\r\n//绘制矩形区\r\nvar imageData = ctx.createImageData(width, height)\r\n// 在 ImageData 下半部分添加颜色\r\nfor (var i = 0; i < width; i += 1) {\r\n    for (var j = height/2; j < height; j += 1) {\r\n        var index = (j * width + i) * 4;\r\n        imageData.data[index + 0] = i;\r\n        imageData.data[index + 1] = Math.floor((i + j) / 2);\r\n        imageData.data[index + 2] = j;\r\n        imageData.data[index + 3] = 255;\r\n    }\r\n}\r\n// 将颜色块，放到指定位置\r\nctx.putImageData(imageData, width/4, height / 4, 0, height / 2, width/4, height / 2);\r\nimageData = ctx.getImageData(0, 0, width, height);\r\nlet success = jsb.saveImageData(imageData.data, width, height, filePath); \r\n```\r\n\r\n- png 图片\r\n\r\n![render_to_sprite_image](https://user-images.githubusercontent.com/26329291/47408874-8e28c100-d793-11e8-8f38-0b7786fca7cd.png)\r\n"},"comment":{"url":"https://api.github.com/repos/cocos-creator-packages/jsb-adapter/issues/comments/432522327","html_url":"https://github.com/cocos-creator-packages/jsb-adapter/pull/61#issuecomment-432522327","issue_url":"https://api.github.com/repos/cocos-creator-packages/jsb-adapter/issues/61","id":432522327,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjUyMjMyNw==","user":{"login":"drelaptop","id":26329291,"node_id":"MDQ6VXNlcjI2MzI5Mjkx","avatar_url":"https://avatars3.githubusercontent.com/u/26329291?v=4","gravatar_id":"","url":"https://api.github.com/users/drelaptop","html_url":"https://github.com/drelaptop","followers_url":"https://api.github.com/users/drelaptop/followers","following_url":"https://api.github.com/users/drelaptop/following{/other_user}","gists_url":"https://api.github.com/users/drelaptop/gists{/gist_id}","starred_url":"https://api.github.com/users/drelaptop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drelaptop/subscriptions","organizations_url":"https://api.github.com/users/drelaptop/orgs","repos_url":"https://api.github.com/users/drelaptop/repos","events_url":"https://api.github.com/users/drelaptop/events{/privacy}","received_events_url":"https://api.github.com/users/drelaptop/received_events","type":"User","site_admin":false},"created_at":"2018-10-24T05:54:35Z","updated_at":"2018-10-24T05:54:35Z","author_association":"CONTRIBUTOR","body":"@pandamicro please review and merge"}}
{"actor":{"display_login":"drelaptop"}}