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. rotate blt ??

rotate blt ??

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestion
3 Posts 3 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.
  • D Offline
    D Offline
    dolph_loe
    wrote on last edited by
    #1

    Is there any way to apply a rotation matrix to a CDC blt? I am trying to draw a rotated bitmap..

    M G 2 Replies Last reply
    0
    • D dolph_loe

      Is there any way to apply a rotation matrix to a CDC blt? I am trying to draw a rotated bitmap..

      M Offline
      M Offline
      Monty2
      wrote on last edited by
      #2

      in NT we have PlgBlt which is not available on 98/ME there are a few articles on CP that rotate an image here[^] i can't even remember what my point is now, but anyway, i'm correct Barring unforeseen acts of God and Adminstrators, my server will be up tomorrow. I'm more worried about the Adminstrators.

      1 Reply Last reply
      0
      • D dolph_loe

        Is there any way to apply a rotation matrix to a CDC blt? I am trying to draw a rotated bitmap..

        G Offline
        G Offline
        GermanGeorge
        wrote on last edited by
        #3

        there you go. the comments are in german, if you have questions feel free to ask. void CWool5View::drehe_bild() { int x,y; int xx,yy; int mipux,mipuy; double a,r,h; double pih=3.14159; BeginWaitCursor(); CClientDC dc(this); int miny,maxy; if(rot_l_yvideogroessex) || (mipuy-yy<0) || (mipuy-yy>videogroessey)) dc.SetPixel(start_videox+x, start_videoy+y, RGB(0,0,0)); else dc.SetPixel(start_videox+x, start_videoy+y, m_pdcMemory->GetPixel(mipux-xx, mipuy-yy)); } //quadrant rechts unten else if( (x-mipux>=0) && (y-mipuy>0)) { //a+=pih; r=sqrt(((x-mipux)*(x-mipux)) + ((y-mipuy)*(y-mipuy)) ); a+=rotation; xx=(r*cos(a)); yy=(r*sin(a)); if((mipux+xx<0) || (mipux+xx>videogroessex) || (mipuy+yy<0) || (mipuy+yy>videogroessey)) dc.SetPixel(start_videox+x, start_videoy+y, RGB(0,0,0)); else dc.SetPixel(start_videox+x, start_videoy+y, m_pdcMemory->GetPixel(mipux+xx, mipuy+yy)); } //quadrant links unten else if( (x-mipux<0) && (y-mipuy>0)) { //a+=pih; r=sqrt(((x-mipux)*(x-mipux)) + ((y-mipuy)*(y-mipuy)) ); a+=rotation; xx=(r*cos(a)); yy=(r*sin(a)); if((mipux-xx<0) || (mipux-xx>videogroessex) || (mipuy-yy<0) || (mipuy-yy>videogroessey)) dc.SetPixel(start_videox+x, start_videoy+y, RGB(0,0,0)); else dc.SetPixel(start_videox+x, start_videoy+y, m_pdcMemory->GetPixel(mipux-xx, mipuy-yy));

        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