0
价值
1
答案
浏览
编译环境是VScode+MinGW,GBK编码
想试一下inputbox,先直接复制了文档上的代码
#include <graphics.h>
#include <conio.h>
int main()
{
// 初始化绘图窗口
initgraph(640, 480);
// 定义字符串缓冲区,并接收用户输入
wchar_t s[10];
InputBox(s, 10, L"请输入半径");
// 将用户输入转换为数字
int r = _wtoi(s);
0
价值
1
答案
浏览
vs2021 X86和x84都无法读取
先是嵌套在这层函数里。
bool window::ifmessage()
{
return ::peekmessage(&m_msg,EM_MOUSE|EM_KEY);
}
在主程序中调用
if (ifmessage())
{
m_msg = getmessage();
switch (m_msg.message)
{
ca
0
价值
1
答案
浏览
在vs2019中创建了一个资源文件夹之后,导入一张bmp图片,运行后图片没有显示
但是如果使用loadimage函数的路径加载就可以显示
resource中相关的宏也有了,loadimage两种加载资源文件中图片的方式都使用了也不行
ps:png可以正常显示
// resource.h文件内容
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ 生成的包含文件。
// 供 LearnC++.rc 使用
//
#define IDB_B
0
价值
2
答案
浏览
用的是EasyX_20200902版本,使用loadimage函数加载图片时,窗口其他地方会变成黑色,代码中把窗口设置为白色,加载了两张图片,运行结果只显示第二张图片,其他地方都是黑色。不知道是哪里的问题。
#include <iostream>
#include <easyx.h>
#include <graphics.h>
#include "mmsystem.h"
#pragma comment(lib,"Winmm.lib")
#include <stdio.h>
0
价值
1
答案
浏览
//编译通过了,运行没效果是怎么回事
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
int main()
{
char a[100], b[50];
srand(time(0));
a[100] = rand() % 26;//生成0-25的随机数
b[100] = rand() % 26;
b[100] += 'A';//字符转换成大写
strcat_s(a, b
0
价值
1
答案
浏览
系统:windows10 专业工作站版
IDE:VS2019
Easyx版本:20210224
尝试过修改字符集,重新安装easyx
#include <graphics.h> // 引用图形库头文件
#include <conio.h>
#include<map>
#include <string>
using namespace std;
class Graphicstool {
public:
static
0
价值
1
答案
浏览
找到了一个通过ReadConsoleOutputCharacter以及WriteConsoleOutputCharacter实现双缓冲的方式,但无法保存更多的字符信息(如颜色等)。
即使是这样,我依然不能够找到能够正常运作的代码或手动实现这样的功能。
这是我从网上找来的代码,还请村长帮忙纠错。
环境为win10 20h2 19042.928,MSVC以及g++编译出的代码均失效。
#include <stdio.h>
#include <Windows.h&
0
价值
1
答案
浏览
#include <easyx.h>
int main()
{
initgraph(1600, 900);
IMAGE* image = new IMAGE();
loadimage(image, _T(R"*(.\Resources\Textures\test.jpg)*"));
float x = 0;
BeginBatchDraw();
while (true)
{
cleardevice();
putimage(x, 0, image);
x += 5;
FlushBatc
0
价值
1
答案
浏览
拼图过程中,移动的图片与鼠标点击的图片不一致,并且有时候会出现多张黑色的图。
#include<stdio.h>
#include<stdlib.h>
#include<easyx.h>
#include<time.h>
#include<conio.h>
void loadResouce();//加载资源
void UserUI();//渲染
void drawMenu();//菜单
void PlayGame();//游戏过程
voi
0
价值
1
答案
浏览
#include<graphics.h>
#include <iostream>
#include<stdio.h>
#include<conio.h>
using namespace std;
void gameinterface() //游戏界面创造
{
IMAGE img_bk1;
initgraph(720, 1280);
loadimage(&img_bk1,"C:\\Users\\momohei\\Desktop\\pao
1
价值
1
答案
浏览
使用mciSendCommand播放一段midi音频,在x86下可以正常播放,但是在x64下没有声音。
#include<Windows.h>
#pragma comment(lib, "winmm.lib")
int main()
{
UINT wDeviceID;
DWORD dwReturn;
MCI_OPEN_PARMS mciOpenParms;
MCI_PLAY_PARMS mciPlayParms;
//打开设备
m
0
价值
1
答案
浏览
#include <graphics.h>
#include <time.h>
#include <conio.h>
#include <ctype.h>
#include <iostream>
using namespace std;
#define MAXSTAR 600 // 星星总数
struct STAR
{
double x;
int y;
double step;
int color;
};
str
1
价值
1
答案
浏览
修用vs2019使用_getch()时下面出现绿色波浪线,显示返回值被忽略
#include <graphics.h>
#include <conio.h>
int main()
{
initgraph(880, 660);
_getch();
closegraph();
return 0;
}
0
价值
1
答案
浏览
在练习时,看到如下一行代码:
setrop2(R2_MERGEPEN);
我查看了settrop2的定义,此定义包含在easyx.h头文件中,解释如下:
void setrop2(int mode); // 设置前景的二元光栅操作模式
我的第一个问题是:我想请问这注释的含义以及此easyx文件中的此行代码是如何运用的?
此后我查看括号中R2