feat:Remove Image's setImagePixels API

This commit is contained in:
pengfei.zhou
2021-11-30 16:20:07 +08:00
committed by osborn
parent 5b5500b6e0
commit e9e2d14a9d
10 changed files with 4 additions and 77 deletions

View File

@@ -606,15 +606,4 @@ public class ImageNode extends ViewNode<ImageView> {
return new JavaValue();
}
}
@DoricMethod
public void setImagePixels(JSObject prop) {
int width = prop.asObject().getProperty("width").asNumber().toInt();
int height = prop.asObject().getProperty("height").asNumber().toInt();
byte[] pixels = prop.asObject().getProperty("pixels").asArrayBuffer().value();
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
ByteBuffer byteBuffer = ByteBuffer.wrap(pixels);
bitmap.copyPixelsFromBuffer(byteBuffer);
mView.setImageBitmap(bitmap);
}
}