2015-05-08 16:02:36 +00:00
|
|
|
/*
|
2023-06-23 11:04:32 +00:00
|
|
|
* PROJECT: PAINT for ReactOS
|
|
|
|
* LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
|
|
|
|
* PURPOSE: Some DIB related functions
|
2023-06-27 18:22:21 +00:00
|
|
|
* COPYRIGHT: Copyright 2015 Benedikt Freisen <b.freisen@gmx.net>
|
2015-05-08 16:02:36 +00:00
|
|
|
*/
|
|
|
|
|
2017-12-09 12:36:45 +00:00
|
|
|
#pragma once
|
|
|
|
|
2023-08-20 07:46:18 +00:00
|
|
|
BOOL IsBitmapBlackAndWhite(HBITMAP hbm);
|
2015-05-08 16:02:36 +00:00
|
|
|
HBITMAP CreateDIBWithProperties(int width, int height);
|
2023-06-19 00:56:02 +00:00
|
|
|
HBITMAP CreateMonoBitmap(int width, int height, BOOL bWhite);
|
2020-04-28 22:44:18 +00:00
|
|
|
HBITMAP CreateColorDIB(int width, int height, COLORREF rgb);
|
2023-06-15 23:05:23 +00:00
|
|
|
HBITMAP CachedBufferDIB(HBITMAP hbm, int minimalWidth, int minimalHeight);
|
2023-08-20 07:46:18 +00:00
|
|
|
HBITMAP ConvertToBlackAndWhite(HBITMAP hbm);
|
2015-05-08 16:02:36 +00:00
|
|
|
|
2023-06-19 00:56:02 +00:00
|
|
|
HBITMAP CopyMonoImage(HBITMAP hbm, INT cx = 0, INT cy = 0);
|
|
|
|
|
2022-01-09 23:50:37 +00:00
|
|
|
static inline HBITMAP CopyDIBImage(HBITMAP hbm, INT cx = 0, INT cy = 0)
|
|
|
|
{
|
|
|
|
return (HBITMAP)CopyImage(hbm, IMAGE_BITMAP, cx, cy, LR_COPYRETURNORG | LR_CREATEDIBSECTION);
|
|
|
|
}
|
|
|
|
|
2015-05-08 16:02:36 +00:00
|
|
|
int GetDIBWidth(HBITMAP hbm);
|
|
|
|
int GetDIBHeight(HBITMAP hbm);
|
|
|
|
|
2023-08-09 14:59:34 +00:00
|
|
|
BOOL SaveDIBToFile(HBITMAP hBitmap, LPCWSTR FileName, BOOL fIsMainFile, REFGUID guidFileType = GUID_NULL);
|
2015-05-08 16:02:36 +00:00
|
|
|
|
2023-07-05 03:06:22 +00:00
|
|
|
HBITMAP DoLoadImageFile(HWND hwnd, LPCWSTR name, BOOL fIsMainFile);
|
2015-05-08 16:02:36 +00:00
|
|
|
|
2023-07-05 03:06:22 +00:00
|
|
|
void SetFileInfo(LPCWSTR name, LPWIN32_FIND_DATAW pFound, BOOL isAFile);
|
2020-04-28 22:44:18 +00:00
|
|
|
|
2023-07-05 03:06:22 +00:00
|
|
|
HBITMAP InitializeImage(LPCWSTR name, LPWIN32_FIND_DATAW pFound, BOOL isFile);
|
|
|
|
HBITMAP SetBitmapAndInfo(HBITMAP hBitmap, LPCWSTR name, LPWIN32_FIND_DATAW pFound, BOOL isFile);
|
2022-02-14 03:08:34 +00:00
|
|
|
|
2023-04-01 13:01:04 +00:00
|
|
|
HBITMAP Rotate90DegreeBlt(HDC hDC1, INT cx, INT cy, BOOL bRight, BOOL bMono);
|
2022-02-14 07:18:18 +00:00
|
|
|
|
2023-06-19 00:56:02 +00:00
|
|
|
HBITMAP SkewDIB(HDC hDC1, HBITMAP hbm, INT nDegree, BOOL bVertical, BOOL bMono = FALSE);
|
2023-03-28 13:31:26 +00:00
|
|
|
|
2023-06-04 02:24:00 +00:00
|
|
|
float PpcmFromDpi(float dpi);
|
|
|
|
|
|
|
|
#define ROUND(x) (INT)((x) + 0.5)
|
2023-06-18 10:48:20 +00:00
|
|
|
|
|
|
|
HGLOBAL BitmapToClipboardDIB(HBITMAP hBitmap);
|
|
|
|
HBITMAP BitmapFromClipboardDIB(HGLOBAL hGlobal);
|
|
|
|
HBITMAP BitmapFromHEMF(HENHMETAFILE hEMF);
|