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 can I get a rotated region?

How can I get a rotated region?

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 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

    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); Thank you very much!

    J 1 Reply Last reply
    0
    • W wangyiming

      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); Thank you very much!

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

      Try with

      HRGN hNewRgn = ExtCreateRegion(&xform,size,pData);

      Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      W 1 Reply Last reply
      0
      • J Joaquin M Lopez Munoz

        Try with

        HRGN hNewRgn = ExtCreateRegion(&xform,size,pData);

        Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

        W Offline
        W Offline
        wangyiming
        wrote on last edited by
        #3

        thanl: Joaquín M López Muñoz, now, I can get the rotated region! the modify codes: DWORD size = GetRegionData(hRgn, sizeof(RGNDATA), NULL); RGNDATA *pData = (RGNDATA*)GlobalAlloc(GMEM_FIXED|GMEM_MOVEABLE,size); GetRegionData(hRgn, size,pData); 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,size,pData); GlobalFree(pData); DeleteObject(hRgn); CodeProject.com Forum problems or suggestions? Reply to a Message Here you can reply to a message in the current discussion thread Forum Visual C++ Subject: Re: How can I get a rotated region? Sender: Joaquín M López Muñoz Date: 2:45 31 Jan '02

        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