Grafica Vectoriala: Proiectul nr.1
Grafica Vectoriala: Proiectul nr.1
vectoriala
Proiectul nr.1
Student: Bradisteanu Elisaveta
Anul de studii
2016 2017
// pro1View.cpp : implementation of the Cpro1View class
//
#include "stdafx.h"
// SHARED_HANDLERS can be defined in an ATL project implementing preview, thumbnail
// and search filter handlers and allows sharing of document code with that project.
#ifndef SHARED_HANDLERS
#include "pro1.h"
#endif
#include "pro1Doc.h"
#include "pro1View.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
#include<math.h>
// Cpro1View
IMPLEMENT_DYNCREATE(Cpro1View, CView)
BEGIN_MESSAGE_MAP(Cpro1View, CView)
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, &CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, &CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, &Cpro1View::OnFilePrintPreview)
ON_WM_CONTEXTMENU()
ON_WM_RBUTTONUP()
END_MESSAGE_MAP()
// Cpro1View construction/destruction
Cpro1View::Cpro1View()
{
// TODO: add construction code here
}
Cpro1View::~Cpro1View()
{
}
BOOL Cpro1View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
// Cpro1View drawing
double fun(double x, double e) {
int k;
double t, s;
k = 0;
t=s=1;
for(k = 1; k<=100; k++){
t *= x/k;
s += t;
}
return s;
}
void Cpro1View::OnDraw(CDC* pDC)
{
Cpro1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
scy));
y = fun(x, e) ;
pDC -> MoveTo(rcClient.CenterPoint().x + (int)(x * scx), rcClient.CenterPoint().y - (int)(y *
x=a;
while(x <=b){
y = fun(x, e) ;