rotate blt ??
-
Is there any way to apply a rotation matrix to a CDC blt? I am trying to draw a rotated bitmap..
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.
-
Is there any way to apply a rotation matrix to a CDC blt? I am trying to draw a rotated bitmap..
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));