How get a rotated standard region
-
1. How can I get a rotated standard region(such as: ellise region, roundrect region)? -------------------------------------------------- HRGN hRgn = CreateRectRgn(0,0,220,120); DWORD size = GetRegionData( hRgn, 1, NULL); RGNDATA *pData = (RGNDATA*)GlobalAlloc(GMEM_FIXED|GMEM_MOVEABLE,size); GetRegionData(hRgn, size,pData); double a = 0.5; // 0 xform.eM11 = (float)cos(a); xform.eM12 = (float)sin(a); xform.eM21 = -xform.eM12; xform.eM22 = xform.eM11; xform.eDx = 0; xform.eDy = 0; HRGN hNewRgn = ExtCreateRegion(&xform,pData->rdh.nRgnSize,pData); // failure! why ? GlobalFree(pData); DeleteObject(hRgn); DeleteObject(hNewRgn); 2. when a modeless dialog is visible, I click mouse outside the dialog , windows send what message by the dialog? ------------------------------------------ my email is wang_yi_ming@263.net Thank you very much!
-
1. How can I get a rotated standard region(such as: ellise region, roundrect region)? -------------------------------------------------- HRGN hRgn = CreateRectRgn(0,0,220,120); DWORD size = GetRegionData( hRgn, 1, NULL); RGNDATA *pData = (RGNDATA*)GlobalAlloc(GMEM_FIXED|GMEM_MOVEABLE,size); GetRegionData(hRgn, size,pData); double a = 0.5; // 0 xform.eM11 = (float)cos(a); xform.eM12 = (float)sin(a); xform.eM21 = -xform.eM12; xform.eM22 = xform.eM11; xform.eDx = 0; xform.eDy = 0; HRGN hNewRgn = ExtCreateRegion(&xform,pData->rdh.nRgnSize,pData); // failure! why ? GlobalFree(pData); DeleteObject(hRgn); DeleteObject(hNewRgn); 2. when a modeless dialog is visible, I click mouse outside the dialog , windows send what message by the dialog? ------------------------------------------ my email is wang_yi_ming@263.net Thank you very much!
1. Are you testing this on a 9x/ME machine?
ExtCreateRegion
only supports rotations on NT/2000/XP. Writing a routine to perform the rotations on aRGNDATA
variable is not terribly difficult, however. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo