[代码]//app.js[代码][代码]var[代码] [代码]THREE = require([代码][代码]"./utils/three-r106.js"[代码][代码]);[代码][代码]var[代码] [代码]GLTFLoader = require([代码][代码]"./utils/GLTFLoader.js"[代码][代码]);[代码][代码]var[代码] [代码]OrbitControls = require([代码][代码]"./utils/OrbitControls.js"[代码][代码]);[代码] [代码]wx.onMemoryWarning([代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]console.log([代码][代码]'....onMemoryWarningReceive'[代码][代码])[代码][代码]})[代码] [代码]App({[代码][代码] [代码][代码]THREE: THREE,[代码][代码] [代码][代码]SystemInfo: wx.getSystemInfoSync(),[代码][代码] [代码][代码]onLaunch: [代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]console.log([代码][代码]'launch...'[代码][代码])[代码][代码] [代码][代码]wx.onMemoryWarning([代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]console.log([代码][代码]'..onMemoryWarningReceive..'[代码][代码])[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码]是这样写吗?
从camera页面到另外一个页面出现闪退如题已上传日志 微信号:mytherf 时间:2019年7月17日16:25左右
2019-07-18在后台用java保存了图片 [代码]public[代码] [代码]static[代码] [代码]void[代码] [代码]readRawImage([代码][代码]byte[代码][代码][] bgraPixelData, [代码][代码]int[代码] [代码]width, [代码][代码]int[代码] [代码]height, String path) [代码][代码]throws[代码] [代码]IOException {[代码][代码] [代码][代码]//4通道[代码][代码] [代码][代码]int[代码] [代码]samplesPerPixel = [代码][代码]4[代码][代码];[代码][代码] [代码][代码]// rgba order[代码][代码] [代码][代码]int[代码][代码][] bandOffsets = {[代码][代码]0[代码][代码], [代码][代码]1[代码][代码], [代码][代码]2[代码][代码], [代码][代码]3[代码][代码]};[代码] [代码] [代码][代码]//byte[] bgraPixelData = new byte[width * height * samplesPerPixel];[代码] [代码] [代码][代码]DataBuffer buffer = [代码][代码]new[代码] [代码]DataBufferByte(bgraPixelData, bgraPixelData.length);[代码][代码] [代码][代码]WritableRaster raster = Raster.createInterleavedRaster(buffer, width, height, samplesPerPixel * width, samplesPerPixel, bandOffsets, [代码][代码]null[代码][代码]);[代码][代码] [代码][代码]ColorModel colorModel = [代码][代码]new[代码] [代码]ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_sRGB), [代码][代码]true[代码][代码], [代码][代码]false[代码][代码], Transparency.TRANSLUCENT, DataBuffer.TYPE_BYTE);[代码] [代码] [代码][代码]BufferedImage image = [代码][代码]new[代码] [代码]BufferedImage(colorModel, raster, colorModel.isAlphaPremultiplied(), [代码][代码]null[代码][代码]);[代码] [代码] [代码][代码]ImageIO.write(image, [代码][代码]"PNG"[代码][代码], [代码][代码]new[代码] [代码]File(path));[代码] [代码] [代码][代码]}[代码]
camera 相机回调后的数据如何存储为图片?获取 Camera 实时帧数据frame.data [代码]const listener = context.onCameraFrame((frame) => {[代码][代码] [代码][代码]console.log(frame.data [代码][代码]instanceof[代码] [代码]ArrayBuffer, frame.width, frame.height)[代码][代码] [代码] [代码]})[代码] 这个frame.data类型是ArrayBuffer [代码]data ArrayBuffer 图像像素点数据,一维数组,每四项表示一个像素点的 rgba[代码]如何将这个数据存储成一个图片? 尝试使用下面的java代码解析无法打开 [代码]Path path = Paths.get(fileDest);[代码][代码]Files.write(path, bFile);[代码]
2019-07-16