C++ 在坐标系中的轴上写入值
在我的程序中,我已经绘制了坐标系,但是我在将值写入Ox,Oy轴时遇到了麻烦。我应该怎么做才能在上面写上值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
#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。。。但却错过了最初的。。。所以如果我想试试的话…谢谢,我会试试的