reactos/base/applications/mspaint/dib.h
Katayama Hirofumi MZ 3e23cdf9ee
[MSPAINT] Some bug fixes on loading/saving files (#5385)
- Display a correct error message on failing to save a file.
- Don't confuse the main file info and the non-main file info.
- Rename ShowFileLoadError as ShowError, and strengthen and move it to dialogs.cpp.
- Add SetFileInfo and InitializeImage helper functions.
- Add IDS_SAVEERROR resource string.
- Modify SaveDIBToFile, SetBitmapAndInfo, and DoLoadImageFile functions.
CORE-18867
2023-07-05 12:06:22 +09:00

45 lines
1.5 KiB
C

/*
* PROJECT: PAINT for ReactOS
* LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
* PURPOSE: Some DIB related functions
* COPYRIGHT: Copyright 2015 Benedikt Freisen <b.freisen@gmx.net>
*/
#pragma once
HBITMAP CreateDIBWithProperties(int width, int height);
HBITMAP CreateMonoBitmap(int width, int height, BOOL bWhite);
HBITMAP CreateColorDIB(int width, int height, COLORREF rgb);
HBITMAP CachedBufferDIB(HBITMAP hbm, int minimalWidth, int minimalHeight);
HBITMAP CopyMonoImage(HBITMAP hbm, INT cx = 0, INT cy = 0);
static inline HBITMAP CopyDIBImage(HBITMAP hbm, INT cx = 0, INT cy = 0)
{
return (HBITMAP)CopyImage(hbm, IMAGE_BITMAP, cx, cy, LR_COPYRETURNORG | LR_CREATEDIBSECTION);
}
int GetDIBWidth(HBITMAP hbm);
int GetDIBHeight(HBITMAP hbm);
BOOL SaveDIBToFile(HBITMAP hBitmap, LPCWSTR FileName, BOOL fIsMainFile);
HBITMAP DoLoadImageFile(HWND hwnd, LPCWSTR name, BOOL fIsMainFile);
void SetFileInfo(LPCWSTR name, LPWIN32_FIND_DATAW pFound, BOOL isAFile);
HBITMAP InitializeImage(LPCWSTR name, LPWIN32_FIND_DATAW pFound, BOOL isFile);
HBITMAP SetBitmapAndInfo(HBITMAP hBitmap, LPCWSTR name, LPWIN32_FIND_DATAW pFound, BOOL isFile);
HBITMAP Rotate90DegreeBlt(HDC hDC1, INT cx, INT cy, BOOL bRight, BOOL bMono);
HBITMAP SkewDIB(HDC hDC1, HBITMAP hbm, INT nDegree, BOOL bVertical, BOOL bMono = FALSE);
float PpcmFromDpi(float dpi);
#define ROUND(x) (INT)((x) + 0.5)
HGLOBAL BitmapToClipboardDIB(HBITMAP hBitmap);
HBITMAP BitmapFromClipboardDIB(HGLOBAL hGlobal);
HBITMAP BitmapFromHEMF(HENHMETAFILE hEMF);