1. BMP file Composition
A bmp file consists of four parts: File Header, bitmap information header, color information, and graphic data.
2. BMP File Header
The data structure of the
We all know that the PHP GD library can easily create a new image from the URL, GD has Imagecreatefromjpeg (), Imagecreatefrompng () .... And so on function can sometimes read from the URL of the cut BMP images and hateful is GD2 imagecreatefrombmp () Although there are imagecreatefromwbmp () but still the difference is still very far!
Use the following function to facilitate the solution
Copy Code code as follows:
function Imagecreatefro
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'::: BMP, GIF, JPG and PNG:::
':::, Original: Junyd:::::::::
'::::: To:::::::::::::--(::), Ouyangdongjie:;::;.:;::
'::: :::
':: This dongdong can get this file from BMP, GIF, JPG and PNG image bytes::
':::::::::::::::::::::::::
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'::: BMP, GIF, JPG and PNG:::
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'::: :::
':: This function gets a specified number of bytes from::
'::: File, starting at the offset (ba
It took several hours to read the format of the BMP file and write a small program...
BMP file format written good article: http://www.cnblogs.com/ZXYloveFR/archive/2012/08/06/2625225.html
BMP file format:
typedef struct tagBITMA
//image preprocessing The 9th step: The final standardized character image is divided into a single single Hdib saved, coexisting as a. bmp filevoidCchildview::onimgprctodibandsave () {unsignedChar*lpsrc; intw,h; W=M_charrect.front (). Width (); H=M_charrect.front (). Height (); M_dibrect.clear (); M_dibrectcopy.clear (); inti_src,j_src; inti,j; intcounts=0; CRect rect,rectnew; BYTE* Lpdib= (byte*):: GlobalLock ((hglobal) m_hdib); BYTE*
BMP format uses a small-end way to store data, the structure of the file header in order as follows:Two bytes: ‘BM‘ represents a Windows Bitmap, ‘BA‘ represents a OS/2 bitmap, a 4-byte integer: Represents the bitmap size, a 4-byte integer: Reserved bit, always 0, and a 4-byte integer: The actual image offset; a 4-byte integer: The number of bytes in the header; A 4-byte integer: Image width; a 4-byte intege
A bmp file consists of four parts: File Header, bitmap information header, color information, and image data:
Bitmapfileheader
Bitmapinfoheader
Bitmap color table rgbquad
Bitmap pixel data
1. Bitmap File Header
The bitmap file header
Tags: des style Io color OS ar Java for SPFile Header + BMP image header + BMP image + (fill byte)The address offset is measured in bytes,The offset between the image data and the file header is the number of bytes of the real BMP image pixel data matrix offset from the beginning of the file.The
Fso
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::'::: BMP, GIF, JPG and PNG:::':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::'::: :::':: This function gets a specified number of bytes from::'::: File, starting at the offset (base
As we all know, the phpGD library can easily create an image from the URL. In GD, imagecreatefromjpeg () and imagecreatefromPNG ()...
We all know that the php GD library can easily create an image from the URL. The GD contains imagecreatefromjpeg (), imagecreatefromPNG ()... and so on.
We all know that the php GD library can easily create an image from the URL. The GD contains imagecreatefromjpeg (), imagecreatefromPNG ().... some functions such as this can sometimes be read from the URL to
We all know that the php GD library can easily create an image from the URL. The GD contains imagecreatefromjpeg (), imagecreatefromPNG ().... some functions such as this can sometimes be read from the URL to cut the BMP image, but what is hateful is that there is no imageCreateFromBMP () in GD2, although there is imagecreatefromWBMP (), the difference is still very far!
You can use the following FUNCTION to conveniently solve the problem.
Copy codeTh
We all know that the phpGD library can easily create an image from the URL. the GD contains imagecreatefromjpeg (), imagecreatefromPNG ().... as we all know, the php GD library can easily create an image from the URL. in GD, imagecreatefromjpeg () and imagecreatefromPNG ().... some functions such as this can sometimes be read from the URL to cut the BMP image, but what is hateful is that there is no imageCreateFromBMP () in GD2, although there is imag
We all know that the php GD library can easily create an image from the URL. The GD contains imagecreatefromjpeg (), imagecreatefromPNG ().... some functions such as this can sometimes be read from the URL to cut the BMP image, but what is hateful is that there is no imageCreateFromBMP () in GD2, although there is imagecreatefromWBMP (), the difference is still very far!You can use the following FUNCTION to conveniently solve the problem.Copy codeThe
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.