We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
最近在研究处理BMP的文件,顺带总结下相关知识点!
//byteBuffer 是图片的byte数据 //数据区的偏移量 byteBuffer.flip(); byte[] dataOffsetArr = new byte[4]; byteBuffer.position(10); byteBuffer.get(dataOffsetArr); int dataOffset = HexUtils.byteArrayToInt(dataOffsetArr, false); logger.info("size:" + dataOffset); //图像的宽度 byte[] widthArr = new byte[4]; byteBuffer.position(18); byteBuffer.get(widthArr); int width = HexUtils.byteArrayToInt(widthArr, false); logger.info("width:" + width); //图像的高度 byte[] highArr = new byte[4]; byteBuffer.position(22); byteBuffer.get(highArr); int high = HexUtils.byteArrayToInt(highArr, false); logger.info("width:" + high); //图像的深度 byte[] depthArr = new byte[4]; byteBuffer.position(28); byteBuffer.get(depthArr); int depth = HexUtils.byteArrayToInt(depthArr, false); logger.info("depth:" + depth); //图像的深度 byte[] sizeArr = new byte[4]; byteBuffer.position(34); byteBuffer.get(sizeArr); int dataSize = HexUtils.byteArrayToInt(sizeArr, false); logger.info("dataSize:" + dataSize); //数据区 byte[] bmpData = new byte[dataSize]; byteBuffer.position(dataOffset); byteBuffer.get(bmpData);
The text was updated successfully, but these errors were encountered:
No branches or pull requests
最近在研究处理BMP的文件,顺带总结下相关知识点!
BMP文件结构
参考链接
The text was updated successfully, but these errors were encountered: