ReactOS 0.4.15-dev-7924-g5949c20
ColorTool Struct Reference
Inheritance diagram for ColorTool:
Collaboration diagram for ColorTool:

Public Member Functions

void fetchColor (BOOL bLeftButton, LONG x, LONG y)
 
BOOL OnMouseMove (BOOL bLeftButton, LONG &x, LONG &y) override
 
BOOL OnButtonUp (BOOL bLeftButton, LONG &x, LONG &y) override
 
- Public Member Functions inherited from ToolBase
 ToolBase ()
 
virtual ~ToolBase ()
 
virtual void OnButtonDown (BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
 
virtual BOOL OnMouseMove (BOOL bLeftButton, LONG &x, LONG &y)
 
virtual BOOL OnButtonUp (BOOL bLeftButton, LONG &x, LONG &y)
 
virtual void OnDrawOverlayOnImage (HDC hdc)
 
virtual void OnDrawOverlayOnCanvas (HDC hdc)
 
virtual void OnSpecialTweak (BOOL bMinus)
 
virtual void OnEndDraw (BOOL bCancel)
 
void beginEvent ()
 
void endEvent ()
 
void reset ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ToolBase
static ToolBasecreateToolObject (TOOLTYPE type)
 
- Public Attributes inherited from ToolBase
HDC m_hdc
 
COLORREF m_fg
 
COLORREF m_bg
 

Detailed Description

Definition at line 612 of file mouse.cpp.

Member Function Documentation

◆ fetchColor()

void ColorTool::fetchColor ( BOOL  bLeftButton,
LONG  x,
LONG  y 
)
inline

Definition at line 614 of file mouse.cpp.

615 {
616 COLORREF rgbColor;
617
618 if (0 <= x && x < imageModel.GetWidth() && 0 <= y && y < imageModel.GetHeight())
619 rgbColor = GetPixel(m_hdc, x, y);
620 else
621 rgbColor = RGB(255, 255, 255); // Outside is white
622
623 if (bLeftButton)
624 paletteModel.SetFgColor(rgbColor);
625 else
626 paletteModel.SetBgColor(rgbColor);
627 }
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
int GetWidth() const
Definition: history.cpp:253
int GetHeight() const
Definition: history.cpp:258
void SetFgColor(COLORREF newColor)
void SetBgColor(COLORREF newColor)
#define RGB(r, g, b)
Definition: precomp.h:71
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
ImageModel imageModel
Definition: history.cpp:11
PaletteModel paletteModel
HDC m_hdc
Definition: toolsmodel.h:43
DWORD COLORREF
Definition: windef.h:300

Referenced by OnButtonUp(), and OnMouseMove().

◆ OnButtonUp()

BOOL ColorTool::OnButtonUp ( BOOL  bLeftButton,
LONG x,
LONG y 
)
inlineoverridevirtual

Reimplemented from ToolBase.

Definition at line 635 of file mouse.cpp.

636 {
637 fetchColor(bLeftButton, x, y);
639 return TRUE;
640 }
ToolsModel toolsModel
Definition: toolsmodel.cpp:10
TOOLTYPE GetOldActiveTool() const
Definition: toolsmodel.cpp:139
void SetActiveTool(TOOLTYPE nActiveTool)
Definition: toolsmodel.cpp:144
#define TRUE
Definition: types.h:120
void fetchColor(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:614

◆ OnMouseMove()

BOOL ColorTool::OnMouseMove ( BOOL  bLeftButton,
LONG x,
LONG y 
)
inlineoverridevirtual

Reimplemented from ToolBase.

Definition at line 629 of file mouse.cpp.

630 {
631 fetchColor(bLeftButton, x, y);
632 return TRUE;
633 }

The documentation for this struct was generated from the following file: