在VC++6.0 中像在turboc中那样画一个图形就这样难吗?(看清楚了再回答)

来源:百度知道 编辑:UC知道 时间:2024/06/15 14:58:11
要像这样写
#include<iostream>
#
#
int main()
{ ////代码??
return 0
}
谁要是用那个什么winmain()的我跟他急
在线等!!!!!!!!
如果可行的话还可以加分的哦!!!

控制台绘图

#include <windows.h>
#include <iostream.h>
#include <wincon.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>

int main(int argc, char* argv[])

{
char arg[200];
arg[0]='\"';
strcpy(arg + 1, argv[0]);
int len=strlen(arg);
arg[len]='\"';

HWND hWnd = FindWindow(NULL, arg); //找到程序运行窗口的句柄

HDC hDC = GetDC(hWnd);
HPEN hPen, hOldPen;
int j=0;

for(; j<500; ++j)
SetPixel(hDC, 10+j, 10+j, 0x0000ff);
hPen=CreatePen(PS_SOLID, 1, 0x00ff00);
hOldPen=(HPEN)SelectObject(hDC, hPen);

MoveToEx(hDC, 20, 50, NULL);
LineTo(hDC, 520, 550);

Arc(hDC, 100, 100, 300, 300, 350, 500, 350, 500);

SelectObject(hDC, hOldPen);

system("pause");
}

LZ很幽默,LS很强大,不过,LS:你的程序能实时刷新么?<