From 37e364b2c6cc7487a1c888d256a73e5337bb7189 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Wed, 14 Jun 2023 00:50:34 +0100 Subject: initial commit --- src/T2DLL/T2BitImage.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/T2DLL/T2BitImage.h (limited to 'src/T2DLL/T2BitImage.h') 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; +}; -- cgit v1.2.3