TouchingVirus
Programmer
Hey to all here @ tek-tips..
The rainbow effect is what i am looking for here...it is annoying me
The above code was taken from "Windows Game Prgoramming For Dummies" and is a random line drawing snippet with random line colors ...
I want to have a window say 320x255, i can create that, but....
i want to draw a horizontal line from 0,0 to 320,0 and i want it to be violet..
i want to draw another horizontal line from 0,1 to 320,1 and i want it to be a lighter shade of violet...
the process continues until i have encorporated violet,indigo,blue,green,yellow,orange & red into the lines..
then a pallete rotation, so that it scrolls and looks like a rainbow,
If my explanation is too longwinded or not clear, i have got a program with the exact effect i can send you, but its a DOS program written in mode13h -> obviously not what i want here
The rainbow effect is what i am looking for here...it is annoying me
Code:
//Start of line drawing...
// get the graphics device context
hdc = GetDC(hwnd);
// create a random colored pen
hpen = CreatePen(PS_SOLID,1,RGB(rand()%256,rand()%256,rand()%256));
// select the pen into context
old_hpen = SelectObject(hdc,hpen);
// move to a random postion
MoveToEx(hdc, rand()%WINDOW_WIDTH, rand()%WINDOW_HEIGHT, NULL);
// draw a line
LineTo(hdc,rand()%WINDOW_WIDTH, rand()%WINDOW_HEIGHT);
// now delete the pen
SelectObject(hdc,old_hpen);
DeleteObject(hpen);
// release the device context
ReleaseDC(hwnd,hdc);
// End of line drawing
The above code was taken from "Windows Game Prgoramming For Dummies" and is a random line drawing snippet with random line colors ...
I want to have a window say 320x255, i can create that, but....
i want to draw a horizontal line from 0,0 to 320,0 and i want it to be violet..
i want to draw another horizontal line from 0,1 to 320,1 and i want it to be a lighter shade of violet...
the process continues until i have encorporated violet,indigo,blue,green,yellow,orange & red into the lines..
then a pallete rotation, so that it scrolls and looks like a rainbow,
If my explanation is too longwinded or not clear, i have got a program with the exact effect i can send you, but its a DOS program written in mode13h -> obviously not what i want here