VS2010如何画坐标曲线

qq_30664421 2015-10-20 02:34:38
matlab中的plot(x,y)功能VS中要如何实现,现在程序中每次循环会得到一个坐标值,VS2010如何读取这些坐标画图
...全文
552 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
paschen 版主 2015-10-20
  • 打赏
  • 举报
回复
在VS下画没有matlab里那么方便 可以使用TeeChart等第三方组件,功能很强大,网上有教如何使用 如:http://czy.t.blog.163.com/blog/static/11691154820123521542342/
赵4老师 2015-10-20
  • 打赏
  • 举报
回复
仅供参考:
#pragma comment(lib,"user32")
#pragma comment(lib,"gdi32")
#include <windows.h>
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
    PAINTSTRUCT ps;
    HDC hdc;
    HFONT hfont,ohfont;
    RECT r;
    COLORREF oc;

    switch(message) {
    case WM_CLOSE://按Alt+F4退出
        PostQuitMessage(0);
        break;
    case WM_PAINT:
        BeginPaint(hWnd, &ps);
        hdc = ps.hdc; // the device context to draw in
        GetClientRect(hWnd, &r); // Obtain the window's client rectangle
        hfont = CreateFont(240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "华文楷体");
        ohfont=(HFONT)SelectObject(hdc,hfont);
        oc=SetTextColor(hdc,0x00C080FF);
        SetBkMode(hdc, TRANSPARENT);
        TextOut(hdc,r.left+r.right/2-720, r.top+r.bottom/2-120,"最短画图程序",12);
        SelectObject(hdc,ohfont);
        SetTextColor(hdc,oc);
        DeleteObject(hfont);
        EndPaint(hWnd, &ps);
        break;
    default:
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    return 0;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
    MSG msg             = {0};
    WNDCLASS wc         = {0};
    HBRUSH hbrh;
    hbrh=CreateSolidBrush(0x00000000);
    wc.lpfnWndProc      = WndProc;
    wc.hInstance        = hInstance;
    wc.hbrBackground    = hbrh;
    wc.lpszClassName    = "minwindowsapp";
    wc.hCursor          = LoadCursor(NULL,IDC_ARROW);
    if( FAILED(RegisterClass(&wc)) ) return 1;

    if(FAILED(CreateWindow(wc.lpszClassName,
                        "Minimal Windows Application",
                        WS_POPUP|WS_VISIBLE,
                        0,
                        0,
                        GetSystemMetrics(SM_CXSCREEN),
                        GetSystemMetrics(SM_CYSCREEN),
                        0,
                        0,
                        hInstance,
                        NULL)))
        return 2;

    while( GetMessage( &msg, NULL, 0, 0 ) > 0 ) {
        DispatchMessage( &msg );
    }
    DeleteObject(hbrh);
    return 0;
}
Line and Curve Functions The following functions are used with lines and curves. AngleArc Arc ArcTo GetArcDirection LineDDA LineDDAProc LineTo MoveToEx PolyBezier PolyBezierTo PolyDraw Polyline PolylineTo PolyPolyline SetArcDirection

64,632

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧