WIN32画图窗口

 

// Graphic0617.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <WINDOWS.H>
int main(int argc, char* argv[])
{
    HWND hw = (HWND)NULL;

    HDC hdc = GetDC(hw);

    HPEN hpen = CreatePen(PS_SOLID,5,RGB(0xff,00,00));

    HBRUSH hbrush = (HBRUSH)GetStockObject(NULL_BRUSH);

    SelectObject(hdc,hpen);
    SelectObject(hdc,hbrush);

    //SetDCBrushColor(hdc,RGB(0xff,0xFF,00));
    //画线
//     MoveToEx(hdc,0,400,NULL);
//     LineTo(hdc,400,400);
    //矩形
    Rectangle(hdc,0,0,400,400);

    DeleteObject(hpen);
    DeleteObject(hbrush);
    ReleaseDC(hw,hdc);

    //printf("Hello World!\n");
    return 0;
}

 

posted @ 2020-06-18 00:33  温暖了寂寞  阅读(122)  评论(0编辑  收藏  举报