我有这段代码:
arr = [1, [2], [3, 4]];
arr.reduce(flatten, []); // [1, 2, 3, 4]
function flatten(a, b) {
return a.concat(b);
}
此代码的问题是输出public static String scaleImage(ImageElement imageElement, String mime_type) {
Canvas canvasTmp = Canvas.createIfSupported();
Context2d context = canvasTmp.getContext2d();
canvasTmp.setCoordinateSpaceWidth(imageElement.getWidth());
canvasTmp.setCoordinateSpaceHeight(imageElement.getHeight());
context.drawImage(imageElement, 0, 0, imageElement.getWidth(), imageElement.getHeight());
// How to set quality?
String tempStr = canvasTmp.toDataUrl(mime_type);
return tempStr;
}
String
只是tempStr