|
![]() | 作者: gk_redondo [gk_redondo]
![]() |
登录 |
#include<windows.h> #define ROUND(a) ((int)(a+0.5)) void Line_DDA(int xs,int ys,int xe,int ye,HDC hdc)/*---DDA算法--*/ { int dx,dy,steps,k; float xIncrement,yIncrement,x=xs,y=ys; dx=xe-xs; dy=ye-ys; if(abs(dx)>abs(dy)) steps=abs(dx); else steps=abs(dy); xIncrement=dx/(float)steps; yIncrement=dy/(float)steps; SetPixel(hdc,ROUND(x),ROUND(y),RGB(0,0,0)); for(k=0;k<steps;k++) { x+=xIncrement; y+=yIncrement; SetPixel(hdc,ROUND(x),ROUND(y),RGB(0,0,0)); } } 怎么在c或c++中调用这个函数?? [此贴被 286(unique) 在 03月26日09时16分 编辑过] |
地主 发表时间: 04-03-24 09:18 |
![]() | 回复: 286 [unique] ![]() |
登录 |
稍微看一下C,就知道了。 |
B1层 发表时间: 04-03-26 09:17 |
|
20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon
粤ICP备05087286号