Click here to Skip to main content
13,095,921 members (56,070 online)
Click here to Skip to main content


42 bookmarked
Posted 26 Mar 2004

Convolution of Bitmaps

, 29 Mar 2006
Article discussing how to convolve images, specificially the convolution of bitmaps.
// ImageConvolutionView.h : interface of the CImageConvolutionView class

#if !defined(AFX_IMAGECONVOLUTIONVIEW_H__4B554328_1B29_4E24_9A47_1497402C76A1__INCLUDED_)
#define AFX_IMAGECONVOLUTIONVIEW_H__4B554328_1B29_4E24_9A47_1497402C76A1__INCLUDED_

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

#include "ImageConvolutionDoc.h"

class CImageConvolutionView : public CView
protected: // create from serialization only

// Attributes
	CImageConvolutionDoc* GetDocument();

// Operations

// Overrides
	// ClassWizard generated virtual function overrides
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);

// Implementation
	COLORREF Convolve(CDC* dc, int sourcex, int sourcey, float kernel[3][3], int nBias,BOOL bGrayscale=FALSE);
	void ConvolveImage(float kernel[3][3], int nBias);
	virtual ~CImageConvolutionView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;


// Generated message map functions
	float m_kernel[3][3];
	int m_nBias;
		// NOTE - the ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !

#ifndef _DEBUG  // debug version in ImageConvolutionView.cpp
inline CImageConvolutionDoc* CImageConvolutionView::GetDocument()
   { return (CImageConvolutionDoc*)m_pDocument; }


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

#endif // !defined(AFX_IMAGECONVOLUTIONVIEW_H__4B554328_1B29_4E24_9A47_1497402C76A1__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.


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


About the Author

Fred Ackers
Web Developer
United States United States
Programming using MFC and ATL for almost 12 years now. Currently studying Operating System implementation as well as Image processing. Previously worked on DSP and the use of FFT for audio application. Programmed using ADO, ODBC, ATL, COM, MFC for shell interfacing, databasing tasks, Internet items, and customization programs.

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.170813.1 | Last Updated 29 Mar 2006
Article Copyright 2004 by Fred Ackers
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid