GDI-SetViewportOrgEx设置DC的绘制原点坐标

 

    hdc = ::GetDC(m_hWnd);
    POINT point;
    BOOL b=SetViewportOrgEx(hdc,100,100,&point);//设置DC的绘制原点
    /*
    参数1:HDC hdc   设备内容HANDLE
    参数2:int X     新Viewport的x坐标
    参数3:int Y     新Viewport的y坐标
    参数4:LPPOINT lpPoint 原来的Viewport的坐标原点,可以为NULL
    
    */


    hrgn1 = CreateRectRgn(10, 10, 200, 200);//创建矩形区域
    hbr = CreateSolidBrush(RGB(0, 0, 255));    //单色的画刷
    FillRgn(hdc, hrgn1, hbr); //用画刷填充区域

    

 

 

 

 

 

 

posted @ 2023-05-17 20:34  天子骄龙  阅读(61)  评论(0)    收藏  举报