iOS: implement Image Pixel

This commit is contained in:
pengfei.zhou
2021-11-22 11:54:47 +08:00
committed by osborn
parent 190eb4afd7
commit b29f2d6a4e
20 changed files with 365 additions and 9 deletions

View File

@@ -3328,6 +3328,25 @@ class Image extends View {
getImagePixels(context) {
return this.nativeChannel(context, "getImagePixels")();
}
setImagePixels(context, imagePixels) {
if (Environment.platform === 'iOS') {
imagePixels.pixels = context.function2Id(() => {
return imagePixels.pixels;
});
}
return this.nativeChannel(context, "setImagePixels")(imagePixels);
}
toModel() {
const ret = super.toModel();
if (Environment.platform === 'iOS') {
if (Reflect.has(ret.props, "imagePixels")) {
const imagePixels = Reflect.get(ret.props, "imagePixels");
const pixels = imagePixels.pixels;
imagePixels.pixels = this.callback2Id(() => pixels);
}
}
return ret;
}
}
__decorate$b([
Property,

File diff suppressed because one or more lines are too long