//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*
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
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
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
Fso
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::'::: BMP, GIF, JPG and PNG:::':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::'::: :::':: This function gets a specified number of bytes from::'::: File, starting at the offset (base
Four components of BMP:
1. File Header information block
0000-0001: File ID, which is the ASCII code "BM ".0002-0005: file size.0006-0009: Reserved. Each byte is set to "00.000a-000d: records the starting position of the image data area. The meaning of each byte is as follows: size of the
1.StretchDIBits function implementationComplete the function:dialog box program, add a button, click the button to display the picture(1) Set Byte*m_pbmpdata as the member variable of the class, we want to load the RGB data of the picture.(2) Background Code of the buttonvoid Cbmp_readdlg::onbnclickedshowbmp () {CFile file;//defines a file object. Open (CString ("C:\\users\\jian\\desktop\\z.bmp"), cfile::mo
FSO ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'::: BMP, GIF, JPG and PNG:::
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
'::::::
':: This function gets a specified number of bytes from::
'::: File, starting at the offset
Microsoft (r) cabinet maker-version 5.1.2600.2180
Copyright (c) Microsoft Corporation. All rights reserved ..
Makecab [/V [N] [/d Var = value...] [/L dir] source [destination]
Makecab [/V [N] [/d Var = value...]/F directive_file [...]
Source file to compress.
Destination File name to give compressed file. If
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.