#include <stdio.h>
#include <easyx.h>
#include <graphics.h> void huayuan()
{
BeginBatchDraw();
cleardevice();//把之前的画板清楚
// setlinestyle(PS_SOLID,5);
//
// setlinecolor(RED);//设置颜色
// setfillcolor(WHITE);
// line(200, 200, 200, 300);
IMAGE imga[]; //定义一个图片变量
loadimage(&imga[], _T("D:/ICON/1.png"),,); //取映像指针,图片路径,图片的x轴坐标,图片y轴坐标
loadimage(&imga[], _T("D:/ICON/2.png"), , );
loadimage(&imga[], _T("D:/ICON/3.png"), , );
loadimage(&imga[], _T("D:/ICON/4.png"), , );
loadimage(&imga[], _T("D:/ICON/5.png"), , );
loadimage(&imga[], _T("D:/ICON/6.png"), , );
loadimage(&imga[], _T("D:/ICON/7.png"), , );
loadimage(&imga[], _T("D:/ICON/8.png"), , );
loadimage(&imga[], _T("D:/ICON/9.png"), , ); for (int i = ; i < ; i++)
{
putimage( , * i, &imga[i]); //将图片存放到显示的界面中, 图片的x轴坐标,图片y轴坐标,取存放图片的指针地址
} EndBatchDraw(); }
int main()
{
initgraph(, , SHOWCONSOLE);
huayuan();
system("pause");
closegraph();
return ;
}

C++ 在界面中添加图片-LMLPHP

04-27 00:35