Hay guys,
I'm trying to generate a sine wave. I have some code but I don't know what i'm missing from it.
Any help or comments would be great.
[code]
void CSine_wave1View::OnPaint()
{
CPaintDC dc(this);
CRect Recto;
GetClientRect(&Recto);
CBrush bgBrush(BLACK_BRUSH);
dc.SelectObject(bgBrush);
dc.Rectangle(Recto);
for (int y=0; y<Recto.Height();y+=20)
{
dc.MoveTo(0,y);
dc.LineTo(Recto.Width(),y);
}
dc.SetMapMode(MM_ANISOTROPIC);
dc.SetViewportOrg(340,200);
dc.SetWindowExt(1000,200);
dc.SetViewportExt(1000,200);
double PI=3.14159;
int ScaleX=100;
int ScaleY=100;
The first thing you'll need is an attention to detail. For example, take an extra 2 seconds to look at your post, notice the code tags didn't work, & fix it.
Since the code you posted is incomplete, and can't be compiled, you should start off by telling us what your code is doing as is and what it should be doing according to you.
Bookmarks