Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

dc clipping region coordinates

How do I find out
display device context clipping region
coordinates ?
Left,top,right,bottom in absolute coordinates from 0,0 of the screen.


The following does not work:

hdc = GetDC(hwnd);
int rleft,rtop,rright,rbottom;
DWORD ret;
//HGDIOBJ hrgn;
HRGN hrgn=NULL;
DWORD dwCount;
LPRGNDATA lpRgnData;
//hrgn=GetCurrentObject(hdc,OBJ_REGION);
ret=GetClipRgn(hdc,hrgn);
ret=GetRegionData((HRGN)hrgn,dwCount,lpRgnData);
rleft=lpRgnData->rdh.rcBound.left;
rtop=lpRgnData->rdh.rcBound.top;
rright=lpRgnData->rdh.rcBound.right;
rbottom=lpRgnData->rdh.rcBound.bottom;
MoveToEx(hdc,0, 0, NULL);
LineTo(hdc, rright-rleft, rbottom-rtop);

Sign In or Register to comment.