drawtree.h
资源名称:tree1.rar [点击查看]
上传用户:yh22282098
上传日期:2021-08-30
资源大小:7k
文件大小:1k
源码类别:
分形几何
开发平台:
Visual C++
- #include<afxwin.h>
- #include<stdlib.h>
- #include<time.h>
- const double PI=3.14159; //PI的值
- const double arg=15*(PI/180); //偏移的角度
- const int len=100; //根父枝的长度
- const double dt_x=0.88; //子枝是父枝的倍数.由x,y合成
- const double dt_y=0.88;
- const double ang=90*(PI/180); //树的倾斜度
- //const short wid=12;//树的初始粗度-宽度
- VOID CALLBACK drawzero(int x,int y,long p);
- int count;
- class CMyApp:public CWinApp
- {
- public:
- virtual BOOL InitInstance();
- };
- class CMainWnd:public CFrameWnd
- {
- public:
- CMainWnd();
- protected:
- afx_msg int OnCreate(LPCREATESTRUCT cs);
- afx_msg void OnPaint();
- DECLARE_MESSAGE_MAP()
- private:
- void drawtree(CPaintDC* pdc,int px,int py,double ang,double l);//,short width
- private:
- double sqt;
- // double angle;
- // int count;
- };