ReactOS 0.4.15-dev-6644-g539123c
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) override
 
void OnButtonUp (BOOL bLeftButton, LONG x, LONG y) override
 
- Public Member Functions inherited from ToolBase
 ToolBase (TOOLTYPE tool)
 
virtual ~ToolBase ()
 
virtual void OnButtonDown (BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
 
virtual void OnMouseMove (BOOL bLeftButton, LONG x, LONG y)
 
virtual void OnButtonUp (BOOL bLeftButton, LONG x, LONG y)
 
virtual void OnCancelDraw ()
 
virtual void OnFinishDraw ()
 
virtual void OnDrawOverlayOnImage (HDC hdc)
 
virtual void OnDrawOverlayOnCanvas (HDC hdc)
 
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 s_pointSP = 0
 
static POINT s_pointStack [256] = { { 0 } }
 
- Protected Member Functions inherited from ToolBase
void OnDrawSelectionOnCanvas (HDC hdc)
 

Detailed Description

Definition at line 407 of file mouse.cpp.

Constructor & Destructor Documentation

◆ ColorTool()

ColorTool::ColorTool ( )
inline

Definition at line 409 of file mouse.cpp.

410 {
411 }
@ TOOL_COLOR
Definition: toolsmodel.h:16

Member Function Documentation

◆ fetchColor()

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

Definition at line 413 of file mouse.cpp.

414 {
415 COLORREF rgbColor;
416
417 if (0 <= x && x < imageModel.GetWidth() && 0 <= y && y < imageModel.GetHeight())
418 rgbColor = GetPixel(m_hdc, x, y);
419 else
420 rgbColor = RGB(255, 255, 255); // Outside is white
421
422 if (bLeftButton)
423 paletteModel.SetFgColor(rgbColor);
424 else
425 paletteModel.SetBgColor(rgbColor);
426 }
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
int GetWidth() const
Definition: history.cpp:194
int GetHeight() const
Definition: history.cpp:199
void SetFgColor(COLORREF newColor)
void SetBgColor(COLORREF newColor)
#define RGB(r, g, b)
Definition: precomp.h:62
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:36
DWORD COLORREF
Definition: windef.h:300

Referenced by OnButtonUp(), and OnMouseMove().

◆ OnButtonUp()

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

Reimplemented from ToolBase.

Definition at line 433 of file mouse.cpp.

434 {
435 fetchColor(bLeftButton, x, y);
437 }
TOOLTYPE GetOldActiveTool() const
Definition: toolsmodel.cpp:85
void SetActiveTool(TOOLTYPE nActiveTool)
Definition: toolsmodel.cpp:90
ToolsModel toolsModel
Definition: toolsmodel.cpp:10
void fetchColor(BOOL bLeftButton, LONG x, LONG y)
Definition: mouse.cpp:413

◆ OnMouseMove()

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

Reimplemented from ToolBase.

Definition at line 428 of file mouse.cpp.

429 {
430 fetchColor(bLeftButton, x, y);
431 }

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