ReactOS  0.4.15-dev-4936-gc06ccce
ColorTool Struct Reference
Inheritance diagram for ColorTool:
Collaboration diagram for ColorTool:

Public Member Functions

 ColorTool ()
 
void fetchColor (BOOL bLeftButton, LONG x, LONG y)
 
void OnMouseMove (BOOL bLeftButton, LONG x, LONG y)
 
void OnButtonUp (BOOL bLeftButton, LONG x, LONG y)
 
- Public Member Functions inherited from ToolBase
 ToolBase (TOOLTYPE tool)
 
virtual ~ToolBase ()
 
virtual void OnButtonDown (BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
 
virtual void OnCancelDraw ()
 
virtual void OnFinishDraw ()
 
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
TOOLTYPE m_tool
 
HDC m_hdc
 
COLORREF m_fg
 
COLORREF m_bg
 
- Static Public Attributes inherited from ToolBase
static INT pointSP = 0
 
static POINT pointStack [256] = { { 0 } }
 

Detailed Description

Definition at line 318 of file mouse.cpp.

Constructor & Destructor Documentation

◆ ColorTool()

ColorTool::ColorTool ( )
inline

Definition at line 320 of file mouse.cpp.

321  {
322  }
ToolBase(TOOLTYPE tool)
Definition: toolsmodel.h:42

Member Function Documentation

◆ fetchColor()

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

Definition at line 324 of file mouse.cpp.

325  {
326  COLORREF rgbColor;
327 
328  if (0 <= x && x < imageModel.GetWidth() && 0 <= y && y < imageModel.GetHeight())
329  rgbColor = GetPixel(m_hdc, x, y);
330  else
331  rgbColor = RGB(255, 255, 255); // Outside is white
332 
333  if (bLeftButton)
334  paletteModel.SetFgColor(rgbColor);
335  else
336  paletteModel.SetBgColor(rgbColor);
337  }
void SetFgColor(COLORREF newColor)
#define RGB(r, g, b)
Definition: precomp.h:62
HDC m_hdc
Definition: toolsmodel.h:37
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
void SetBgColor(COLORREF newColor)
int GetWidth() const
Definition: history.cpp:215
DWORD COLORREF
Definition: windef.h:300
ImageModel imageModel
Definition: main.cpp:32
int GetHeight() const
Definition: history.cpp:220
PaletteModel paletteModel
Definition: main.cpp:28
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by OnButtonUp(), and OnMouseMove().

◆ OnButtonUp()

void ColorTool::OnButtonUp ( BOOL  bLeftButton,
LONG  x,
LONG  y 
)
inlinevirtual

Reimplemented from ToolBase.

Definition at line 344 of file mouse.cpp.

345  {
346  fetchColor(bLeftButton, x, y);
348  }
ToolsModel toolsModel
Definition: main.cpp:18
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
void fetchColor(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:324
TOOLTYPE GetOldActiveTool() const
Definition: toolsmodel.cpp:81
void SetActiveTool(TOOLTYPE nActiveTool)
Definition: toolsmodel.cpp:86
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ OnMouseMove()

void ColorTool::OnMouseMove ( BOOL  bLeftButton,
LONG  x,
LONG  y 
)
inlinevirtual

Reimplemented from ToolBase.

Definition at line 339 of file mouse.cpp.

340  {
341  fetchColor(bLeftButton, x, y);
342  }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
void fetchColor(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:324
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

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