#pragma once
// MandelbrotSetWindow
class MandelbrotSetWindow : public CWnd
{
DECLARE_DYNAMIC(MandelbrotSetWindow)
public:
MandelbrotSetWindow();
virtual ~MandelbrotSetWindow();
void DrawMandelbrotSet();
void DrawMandelbrotSet(CRect& rc);
double scaled2line(double lenth, double rangeLeft, double rangeRight, double subLenth);
COLORREF MandelbrotIterColor(int Iter);
void DrawSet(CRect &rc);
CRect m_RcMandelbrotSet;
double m_dLimitUpX;
double m_dLimitUpY;
double m_dLimitDownX;
double m_dLimitDownY;
int m_MaxIterations;
COLORREF *m_palette;//[255 * 255 * 255];
CPoint m_ptLeftTop;
CPoint m_ptRightBottom;
protected:
DECLARE_MESSAGE_MAP()
public:
//LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect,, CCreateContext* pContext = NULL
virtual BOOL Create( CWnd* pParentWnd, UINT nID);
afx_msg void OnPaint();
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
private:
bool m_bISLbuttonDown;
CRect m_oldRect;
};
// MandelbrotSetWindow.cpp : implementation file
//
#include "stdafx.h"
#include "MandelbrotSetDemo.h"
#include "MandelbrotSetWindow.h"
// MandelbrotSetWindow
IMPLEMENT_DYNAMIC(MandelbrotSetWindow, CWnd)
MandelbrotSetWindow::MandelbrotSetWindow()
{
m_dLimitUpX = 1.0;
m_dLimitUpY = 1.0;