Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How get a rotated standard region

How get a rotated standard region

Scheduled Pinned Locked Moved C / C++ / MFC
questioncsharp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wangyiming
    wrote on last edited by
    #1

    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!

    J 1 Reply Last reply
    0
    • W wangyiming

      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!

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      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 a RGNDATA variable is not terribly difficult, however. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups