Commit e04388aa authored by ElenaSubbotina's avatar ElenaSubbotina

.

parent cee61e7a
...@@ -71,26 +71,26 @@ namespace DocFileFormat ...@@ -71,26 +71,26 @@ namespace DocFileFormat
{ {
struct __BITMAPINFOHEADER struct __BITMAPINFOHEADER
{ {
DWORD biSize; _UINT32 biSize;
LONG biWidth; _INT32 biWidth;
LONG biHeight; _INT32 biHeight;
WORD biPlanes; _UINT16 biPlanes;
WORD biBitCount; _UINT16 biBitCount;
DWORD biCompression; _UINT32 biCompression;
DWORD biSizeImage; _UINT32 biSizeImage;
LONG biXPelsPerMeter; _INT32 biXPelsPerMeter;
LONG biYPelsPerMeter; _INT32 biYPelsPerMeter;
DWORD biClrUsed; _UINT32 biClrUsed;
DWORD biClrImportant; _UINT32 biClrImportant;
}; };
struct __BITMAPCOREHEADER struct __BITMAPCOREHEADER
{ {
DWORD bcSize; /* used to get to color table */ _UINT32 bcSize; /* used to get to color table */
WORD bcWidth; _UINT16 bcWidth;
WORD bcHeight; _UINT16 bcHeight;
WORD bcPlanes; _UINT16 bcPlanes;
WORD bcBitCount; _UINT16 bcBitCount;
}; };
Global::BlipType GetFormatPict(unsigned char* data, int size) Global::BlipType GetFormatPict(unsigned char* data, int size)
{ {
......
...@@ -37,29 +37,29 @@ ...@@ -37,29 +37,29 @@
namespace ImageHelper namespace ImageHelper
{ {
struct __BITMAPINFOHEADER struct __BITMAPINFOHEADER
{ {
DWORD biSize; _UINT32 biSize;
LONG biWidth; _INT32 biWidth;
LONG biHeight; _INT32 biHeight;
WORD biPlanes; _UINT16 biPlanes;
WORD biBitCount; _UINT16 biBitCount;
DWORD biCompression; _UINT32 biCompression;
DWORD biSizeImage; _UINT32 biSizeImage;
LONG biXPelsPerMeter; _INT32 biXPelsPerMeter;
LONG biYPelsPerMeter; _INT32 biYPelsPerMeter;
DWORD biClrUsed; _UINT32 biClrUsed;
DWORD biClrImportant; _UINT32 biClrImportant;
}; };
struct __BITMAPCOREHEADER struct __BITMAPCOREHEADER
{ {
DWORD bcSize; /* used to get to color table */ _UINT32 bcSize; /* used to get to color table */
WORD bcWidth; _UINT16 bcWidth;
WORD bcHeight; _UINT16 bcHeight;
WORD bcPlanes; _UINT16 bcPlanes;
WORD bcBitCount; _UINT16 bcBitCount;
}; };
inline Global::_BlipType SaveImageToFileFromDIB(unsigned char* data, int size, const std::wstring& file_name)//without ext inline Global::_BlipType SaveImageToFileFromDIB(unsigned char* data, int size, const std::wstring& file_name)//without ext
{ {
...@@ -152,10 +152,10 @@ namespace ImageHelper ...@@ -152,10 +152,10 @@ namespace ImageHelper
NSFile::CFileBinary file; NSFile::CFileBinary file;
if (file.CreateFileW(file_name + L".bmp")) if (file.CreateFileW(file_name + L".bmp"))
{ {
WORD vtType = 0x4D42; file.WriteFile((BYTE*)&vtType, 2); _UINT16 vtType = 0x4D42; file.WriteFile((BYTE*)&vtType, 2);
DWORD dwLen = biSizeImage; file.WriteFile((BYTE*)&dwLen, 4); _UINT32 dwLen = biSizeImage; file.WriteFile((BYTE*)&dwLen, 4);
DWORD dwRes = 0; file.WriteFile((BYTE*)&dwRes, 4); _UINT32 dwRes = 0; file.WriteFile((BYTE*)&dwRes, 4);
DWORD dwOffset = 2; file.WriteFile((BYTE*)&dwOffset, 4); _UINT32 dwOffset = 2; file.WriteFile((BYTE*)&dwOffset, 4);
file.WriteFile((BYTE*)data, size); file.WriteFile((BYTE*)data, size);
file.CloseFile(); file.CloseFile();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment