diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-06-14 00:50:34 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-06-14 00:50:34 +0100 |
commit | 37e364b2c6cc7487a1c888d256a73e5337bb7189 (patch) | |
tree | eaf6e857382eef16c2dd940eb4125536fbe068bd /src/T2DLL/T2BitImage.h | |
download | t2win-37e364b2c6cc7487a1c888d256a73e5337bb7189.tar.gz t2win-37e364b2c6cc7487a1c888d256a73e5337bb7189.zip |
initial commit
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2BitImage.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/T2DLL/T2BitImage.h b/src/T2DLL/T2BitImage.h new file mode 100644 index 0000000..5e23a62 --- /dev/null +++ b/src/T2DLL/T2BitImage.h @@ -0,0 +1,56 @@ +#pragma once +#include "common.h" + +// unknown name +struct Bitmap { + BITMAPINFOHEADER header; + short palette[256]; +}; + +class DLL_EXPORT T2BitImage { +public: + T2BitImage(const char* path, unsigned int id, BOOL flip); + T2BitImage(HINSTANCE path, unsigned int id, BOOL flip); + T2BitImage(const RECT&); + virtual ~T2BitImage(); + virtual BOOL IsExist(); + + BOOL BeginDrawing(); + void EndDrawing(); + void CopyImage(T2BitImage&, const RECT&, const RECT&, int, CRgn*); + void CopyImage(CDC*, const RECT&, const RECT&, int, CRgn*); + void Clear(int); + void SetBackGndColor(int); + void SetForeGndColor(int); + void SetOrigin(int, int); + void SetClipRect(RECT*); + void SetHalftoneMode(BOOL); + void DrawFocusRect(RECT); + void FillMesh(RECT, int); + void FillRect(RECT, int); + int GetPixel(int, int); + int GetPixel(const POINT&); + void DrawFrameRect(RECT, int); + + int GetParam() { return mParam; } + void SetParam(int v) { mParam = v; } + +protected: + friend class T2ImageObj; + + void SetupBitmap(BITMAPINFO* info, BOOL flip); + void DrawFocusRect2(RECT); + void DrawFocusLine(int, int, int, int); + void DrawFrameLine(int, int, int, int, int); + + Bitmap mBitmap; + unsigned char *mData; + POINT mOrigin; + HGLOBAL mMemHandle; + int mForeGndColor; + int mBackGndColor; + RECT mClipRect; + BOOL mHasClipRect; + BOOL mHalftoneMode; + int mParam; +}; |