remove paint::gadget

This commit is contained in:
Jinhao
2015-08-20 01:09:29 +08:00
parent 4323977908
commit 42443dcafd
27 changed files with 1024 additions and 763 deletions

View File

@@ -845,13 +845,13 @@ namespace paint
BITMAPFILEHEADER bmFileHeader = { 0 };
bmFileHeader.bfType = 0x4d42; //bmp
bmFileHeader.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);
bmFileHeader.bfSize = bmFileHeader.bfOffBits + imageBytes;
bmFileHeader.bfSize = bmFileHeader.bfOffBits + static_cast<DWORD>(imageBytes);
HANDLE hFile = ::CreateFileW(static_cast<std::wstring>(::nana::charset(file_utf8, ::nana::unicode::utf8)).data(), GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
DWORD dwWrite = 0;
::WriteFile(hFile, &bmFileHeader, sizeof(BITMAPFILEHEADER), &dwWrite, nullptr);
::WriteFile(hFile, &bmpInfo.bmiHeader, sizeof(BITMAPINFOHEADER), &dwWrite, nullptr);
::WriteFile(hFile, pData, imageBytes, &dwWrite, nullptr);
::WriteFile(hFile, pData, static_cast<DWORD>(imageBytes), &dwWrite, nullptr);
::CloseHandle(hFile);
::DeleteObject(hBmp);