c++ - 在DOS下,如何创建一个窗口用于绘图。
ringa_lee
ringa_lee 2017-04-17 15:06:55
[C++讨论组]

程序写了一点,发现应该先用C++的框架创建窗口,现在在DOS下怎么调用windows的一个窗口用于画点画线

#include "stdafx.h"
#include
#include
#include
#include  //用到了time函数 
#include 
#include 

using namespace std;

 //声明用来处理消息的函数
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);  

//窗口类对象

//函数功能:产生一个窗口


//函数功能:产生随机数
int stochastic()
{
    int sto=0;//随机数
    srand((unsigned)time(NULL)); //用时间做种,每次产生随机数不一样
    sto= rand() % 4;  //产生0-3的随机数
    
    /*测试随机数生成的代码    
        int testone = 0;
        cout <> testone;
    */

    
    return sto;
}

//函数功能:让用户输入数字完成选择目标机型
int getinair_type(int atype)
{
    cout << "请输入数字选择目标类型"<> atype;
    while (atype > 4 || atype < 1)
    {
        cout << "输入有误,重新输入" << endl;
        system("cls");
        atype=getinair_type(atype);
    }
    return atype;

}

//函数功能:在随机状态下 完成对机型的赋值
int FUNCaircraft()
{
    int aircraft_type = 0;
    int stoc = stochastic();
    aircraft_type = stoc + 1;
    return aircraft_type;
}

//状态机一 
int stateone()
{
    int choice_model = 0;//choice_model代表用户选择是否完全随机 1是完全随机 2是指定目标类型
    int aircraft_typw = 0;//aircraft_typw代表飞行目标类型

    cout << "请输入数字代表想定生成方式" << endl << "1.完全随机    2.制定目标类型" << endl;
    cin >> choice_model;
    if (choice_model == 1)
    {
        cout << "选择完全随机"<>nextkey;

    /* 
        测试代码 没啥用
        int testone = 0;
        cin >> testone;
        if(testone==1)
    */
    
    state2th(airtp);
    while (1);
    return 0;
}
ringa_lee
ringa_lee

ringa_lee

全部回复(1)
PHPz

可以试试OpenCV或者octave

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号