Click here to Skip to main content
Click here to Skip to main content
Articles » Multimedia » GDI » General » Downloads
 
Add your own
alternative version

QuickFill: An efficient flood fill algorithm.

, 12 Mar 2004
Design and implimentation of efficient flood fill algorithms.
quickfilldemo_demo.zip
QuickFillDemo.exe
quickfilldemo_src.zip
CDibData
Doxygen.dat
CQuantize
QuickFill
test.bmp
QuickFillDemo
Debug
QuickFillDemo.clw
QuickFillDemo.dsp
QuickFillDemo.dsw
Release
res
bitmap1.bmp
bmp00001.bmp
bmp00002.bmp
bmp00003.bmp
bmp00004.bmp
checker.bmp
checker2.bmp
circle.bmp
clubs.bmp
cross.bmp
dchecker.bmp
diamon.bmp
dimonds.bmp
hart.bmp
it.bmp
ldiag.bmp
ne.bmp
nw.bmp
QuickFillDemo.ico
QuickFillDemoDoc.ico
rdiag.bmp
schecker.bmp
scircle.bmp
se.bmp
spades.bmp
square.bmp
sw.bmp
x.bmp
xsquare.bmp
// QuickFillDemoView.h : interface of the CQuickFillDemoView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_QUICKFILLDEMOVIEW_H__2DDFAE38_E030_4BB8_B81E_A6B77A4711E6__INCLUDED_)
#define AFX_QUICKFILLDEMOVIEW_H__2DDFAE38_E030_4BB8_B81E_A6B77A4711E6__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#ifndef __CDIBDATA_H__
#include "QuickFill.h"
#endif

class CQuickFillDemoView : public CScrollView
{
protected: // create from serialization only
	CQuickFillDemoView();
	DECLARE_DYNCREATE(CQuickFillDemoView)

private:
	CRect m_rcPos;
	COLORREF m_clrFill;
	int m_nMag;
	unsigned m_nMask;
	double m_dSeconds;
	CPoint m_AnchorPoint;
	CRect m_rcSelect;
	BOOL m_bSelecting;
	BOOL m_bSelected;

// Attributes
public:
	CQuickFillDemoDoc* GetDocument();
	CQuickFill m_Fill;

// Operations
public:
	void Magnify(int nMag);
	void DrawSelectRect(CDC* pDC);

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CQuickFillDemoView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual void OnInitialUpdate(); // called first time after construct
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CQuickFillDemoView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CQuickFillDemoView)
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnOpenpattern();
	afx_msg void OnUpdateOpenpattern(CCmdUI* pCmdUI);
	afx_msg void OnSlowmode();
	afx_msg void OnUpdateSlowmode(CCmdUI* pCmdUI);
	afx_msg void OnFillcolor();
	afx_msg void OnUpdateFillcolor(CCmdUI* pCmdUI);
	afx_msg void OnPatternclearcolor();
	afx_msg void OnUpdatePatternclearcolor(CCmdUI* pCmdUI);
	afx_msg void OnClosepattern();
	afx_msg void OnUpdateClosepattern(CCmdUI* pCmdUI);
	afx_msg void OnViewMag1();
	afx_msg void OnUpdateViewMag1(CCmdUI* pCmdUI);
	afx_msg void OnViewMag2();
	afx_msg void OnUpdateViewMag2(CCmdUI* pCmdUI);
	afx_msg void OnViewMag3();
	afx_msg void OnUpdateViewMag3(CCmdUI* pCmdUI);
	afx_msg void OnViewMag4();
	afx_msg void OnUpdateViewMag4(CCmdUI* pCmdUI);
	afx_msg void OnViewMag5();
	afx_msg void OnUpdateViewMag5(CCmdUI* pCmdUI);
	afx_msg void OnViewMag6();
	afx_msg void OnUpdateViewMag6(CCmdUI* pCmdUI);
	afx_msg void OnViewMag7();
	afx_msg void OnUpdateViewMag7(CCmdUI* pCmdUI);
	afx_msg void OnViewMag8();
	afx_msg void OnUpdateViewMag8(CCmdUI* pCmdUI);
	afx_msg void OnViewMag9();
	afx_msg void OnUpdateViewMag9(CCmdUI* pCmdUI);
	afx_msg void OnViewMag10();
	afx_msg void OnUpdateViewMag10(CCmdUI* pCmdUI);
	afx_msg void OnFillmask();
	afx_msg void OnUpdateFillmask(CCmdUI* pCmdUI);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnShowrevisit();
	afx_msg void OnUpdateShowrevisit(CCmdUI* pCmdUI);
	//}}AFX_MSG
	afx_msg void OnUpdatePos(CCmdUI *pCmdUI);
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in QuickFillDemoView.cpp
inline CQuickFillDemoDoc* CQuickFillDemoView::GetDocument()
   { return (CQuickFillDemoDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_QUICKFILLDEMOVIEW_H__2DDFAE38_E030_4BB8_B81E_A6B77A4711E6__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

John R. Shaw
Software Developer
United States United States
I am a senior software engineer who has been designing and developing software for many years, mostly in C/C++. You might say that I think in code; which is why I am passionate about my first rule of coding: “First do no harm”. So if I get carried away in my explanations, please realize that it is just part of my personality. I enjoy learning new things and, when I have the time, passing that knowledge onto others.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.1411023.1 | Last Updated 13 Mar 2004
Article Copyright 2004 by John R. Shaw
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid