Skip to content

Commit 9596d52

Browse files
committed
fix image convert function and update demo
1 parent bfe9433 commit 9596d52

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+363
-314
lines changed

demo/app/main-view-model.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ export class HelloWorldModel extends Observable {
1919

2020
public getMyDrawing() {
2121
this._myDrawingPad.getDrawing().then(res => {
22-
console.log(res);
2322
// convert native image data (bitmap on android) to imageSource for NS
24-
const image = ImageSource.fromDataSync(res);
25-
console.log('trying to set image');
23+
const image = new ImageSource(res);
24+
const base64imageString = image.toBase64String('jpg'); // if you need it as base64
2625
this.set('drawingImage', image);
2726
});
2827
}

demo/nativescript.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NativeScriptConfig } from '@nativescript/core';
22

33
export default {
44
id: 'org.nativescript.demo',
5-
appResourcesPath: 'app/App_Resources',
5+
appResourcesPath: 'App_Resources',
66
android: {
77
v8Flags: '--expose_gc',
88
markingMode: 'none'

demo/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@
44
"@nativescript-community/drawingpad": "file:../src",
55
"nativescript-theme-core": "~1.0.4",
66
"nativescript-unit-test-runner": "^0.5.0",
7-
"@nativescript/core": "~7.0.5"
7+
"@nativescript/core": "~7.1.1"
88
},
99
"devDependencies": {
10-
"@nativescript/android": "7.0.0",
11-
"@nativescript/types": "~7.0.4",
12-
"@nativescript/webpack": "~3.0.4",
10+
"@nativescript/android": "7.0.1",
11+
"@nativescript/types": "~7.1.0",
12+
"@nativescript/webpack": "~4.0.0",
1313
"jasmine-core": "3.3.0",
1414
"karma": "4.0.1",
1515
"karma-jasmine": "1.1.2",
1616
"karma-nativescript-launcher": "0.4.0",
17-
"nativescript-dev-typescript": "~0.8.0",
1817
"tslint": "~5.13.1",
19-
"typescript": "~3.9.7"
18+
"typescript": "~4.1.3"
2019
},
2120
"scripts": {
2221
"build.plugin": "cd ../src && npm run build",

0 commit comments

Comments
 (0)