F:\计算机文件\测试\one.cpp(7) : error C2665: 'setlinestyle' : none of the 2 overloads can convert parameter 3 from type 'const int'
执行 cl.exe 时出错.
#include <graphics.h>
#include <conio.h>
void main()
{
initgraph(640, 480); // 初始化 640 x 480 的绘图窗口
setlinestyle(PS_SOLID, NULL, 10); // 设置线宽为 10,这样效果明显
rectangle(100,100,200,200); // 画一个矩形,当做背景图案
setwritemode(R2_XORPEN); // 设置 XOR 绘图模式
setcolor(RED); // 设置画线颜色
line(50,0, 200,300); // 画线
getch(); // 等待按任意键
line(50,0, 200,300); // 画线(XOR 方式重复画线会恢复背景图案)
getch(); // 等待按任意键
closegraph(); // 关闭绘图窗口
}
执行 cl.exe 时出错.
#include <graphics.h>
#include <conio.h>
void main()
{
initgraph(640, 480); // 初始化 640 x 480 的绘图窗口
setlinestyle(PS_SOLID, NULL, 10); // 设置线宽为 10,这样效果明显
rectangle(100,100,200,200); // 画一个矩形,当做背景图案
setwritemode(R2_XORPEN); // 设置 XOR 绘图模式
setcolor(RED); // 设置画线颜色
line(50,0, 200,300); // 画线
getch(); // 等待按任意键
line(50,0, 200,300); // 画线(XOR 方式重复画线会恢复背景图案)
getch(); // 等待按任意键
closegraph(); // 关闭绘图窗口
}