0

Is anyone aware of a way to apply affine transformations on windows, using the Desktop Window Manager, or a combination of that with DirectX?

Think of Flip3D in Windows 7 - if I wanted to do such transitions live on the Desktop.

Clarification: The question is regarding DWM enabled windows only. So Windows >= 7.

daniel.gindi
  • 3,457
  • 1
  • 30
  • 36
  • The only way to do what you want seems to be hooking the DWM draw functions for modify the received data (window texture). DWM uses DirectX and composes all the desktop windows into D3D textures (it uses DX9 for Vista, DX10 for 7, DX11 for 8 and so on). So you just need to modify the window texture drawn to the screen. Maybe after that there's an problem with mouse click coordinates, but that's just theory. You can read here (translate to English, it's russian) for knowing a little more about how DWM works: http://shchetinin.blogspot.com/2012/04/dwm-graphics-directx-win8win7.html – Michael Jauregui Jan 25 '20 at 18:35

2 Answers2

-1

Microsoft has a 2D affine transform effect within the built-in effects

An example from the documentation in C++ would be:

ComPtr<ID2D1Effect> affineTransformEffect;
m_d2dContext->CreateEffect(CLSID_D2D12DAffineTransform, &affineTransformEffect);

affineTransformEffect->SetInput(0, bitmap);

D2D1_MATRIX_3X2_F matrix = D2D1::Matrix3x2F(0.9f, -0.1f,   0.1f, 0.9f,   8.0f, 45.0f);

affineTransformEffect->SetValue(D2D1_2DAFFINETRANSFORM_PROP_TRANSFORM_MATRIX, matrix);

m_d2dContext->BeginDraw();
m_d2dContext->DrawImage(affineTransformEffect.Get());
m_d2dContext->EndDraw();

Which performs the following matrix operation:
https://msdn.microsoft.com/dynimg/IC554554.png

Tim Penner
  • 3,551
  • 21
  • 36
-1

There was a library written for Win95/XP/Win2000 called "madotate". It was an opensource C++ API for doing 3d flips etc on windows. Probably wouldn't take too much to adapt to DWM if it hasn't been already.

user5976242
  • 204
  • 2
  • 5
  • Why do you think it's an open source library? From what I know, it's a closed source software. Can't find any reference for an "open source library" by that name. – daniel.gindi Mar 22 '16 at 08:10
  • I have the library source I downloaded several years ago. Let me see if I can find the link. – user5976242 Mar 23 '16 at 16:35
  • I originally downloaded this from soureforge. Which probably led me to assume opensource. I do not see an open source license in the files. However, the techniques you are looking for are most likely here. http://www.ksky.ne.jp/~seahorse/mtate2/file/mtate20202src.lzh – user5976242 Mar 23 '16 at 16:47