mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
toImage changed to use fromData
This commit is contained in:
@ -66,9 +66,7 @@ export function request(options: http.HttpRequestOptions): promises.Promise<http
|
|||||||
toString: () => { return outputStream.toString(); },
|
toString: () => { return outputStream.toString(); },
|
||||||
toJSON: () => { return JSON.parse(outputStream.toString()); },
|
toJSON: () => { return JSON.parse(outputStream.toString()); },
|
||||||
toImage: () => {
|
toImage: () => {
|
||||||
var bytes = outputStream.toByteArray();
|
return require("image-source").fromData(new java.io.ByteArrayInputStream(outputStream.toByteArray()));
|
||||||
var bitmap = android.graphics.BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
|
|
||||||
return require("image-source").fromNativeSource(bitmap);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
statusCode: rawHeaders.getResponseCode(),
|
statusCode: rawHeaders.getResponseCode(),
|
||||||
|
Reference in New Issue
Block a user