Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/126.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 在坐标系中的轴上写入值_C++_Graphics - Fatal编程技术网

C++ 在坐标系中的轴上写入值

C++ 在坐标系中的轴上写入值,c++,graphics,C++,Graphics,在我的程序中,我已经绘制了坐标系,但是我在将值写入Ox,Oy轴时遇到了麻烦。我应该怎么做才能在上面写上值 #include<iostream> #include<fstream> #include"graphics.h" using namespace std; const int WIDTH=800,HEIGHT=600; void drawLine (int MovetoX,int MovetoY,int drawX,int drawY,int color,in

在我的程序中,我已经绘制了坐标系,但是我在将值写入Ox,Oy轴时遇到了麻烦。我应该怎么做才能在上面写上值

#include<iostream>
#include<fstream>
#include"graphics.h"

using namespace std;
const int WIDTH=800,HEIGHT=600;

void drawLine (int MovetoX,int MovetoY,int drawX,int drawY,int  color,int textX,int textY)
{          
    moveto(MovetoX,MovetoY);
    setcolor(color);
    lineto(drawX,drawY);
}
int main()
{
    drawLine(0,HEIGHT/2,WIDTH,HEIGHT/2,WHITE,WIDTH-20,HEIGHT/2+10);
    drawLine(WIDTH/2,0,WIDTH/2,HEIGHT,WHITE,WIDTH-20,HEIGHT/2+10);
}
#包括
#包括
#包括“graphics.h”
使用名称空间std;
常数int宽度=800,高度=600;
无效抽绳(int-MovetoX、int-MovetoY、int-drawX、int-drawY、int-color、int-textX、int-textY)
{          
moveto(MovetoX,MovetoY);
设置颜色(颜色);
lineto(drawX,drawY);
}
int main()
{
抽绳(0,高度/2,宽度,高度/2,白色,宽度-20,高度/2+10);
抽绳(宽度/2,0,宽度/2,高度,白色,宽度-20,高度/2+10);
}

我希望看到Ox、Oy轴上的数值。

你是说用数字标记轴吗?;你的图形库是什么?它有一些字体渲染功能吗?这看起来像BGI。。。但却错过了最初的。。。所以如果我想试试的话…谢谢,我会试试的