direct2d

Drawing visual behind a window using directx

孤者浪人 提交于 2021-02-11 17:17:09
问题 Is there any way to draw the content behind a window using directx. For example: the magnifier used by windows. I was trying to achieve the acrylic blur effect of windows 10. What I need to do is to capture the portion behind the window and blur it using direct 2D Gaussian Blur effect. So is there any way to get the backdrop (visual behind the window) using direct x? Note: i tried using magnifier api of windows and it is flickering the screen while resizing or moving the window Here is a

Drawing visual behind a window using directx

淺唱寂寞╮ 提交于 2021-02-11 17:12:12
问题 Is there any way to draw the content behind a window using directx. For example: the magnifier used by windows. I was trying to achieve the acrylic blur effect of windows 10. What I need to do is to capture the portion behind the window and blur it using direct 2D Gaussian Blur effect. So is there any way to get the backdrop (visual behind the window) using direct x? Note: i tried using magnifier api of windows and it is flickering the screen while resizing or moving the window Here is a

How to create a transparent bitmap in Direct2D

女生的网名这么多〃 提交于 2021-02-07 08:22:35
问题 I need to create a transparent bitmap using Direct2D and draw, by using my device context, on it. ID2D1DeviceContext1* d2dContext = ... ID2D1Bitmap* pBitmap; d2dContext->CreateBitmap( bitmapSize, nullptr, 0, D2D1::BitmapProperties1( D2D1_BITMAP_OPTIONS_TARGET, D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED), dpiX, dpiY), &pBitmap); d2dContext->BeginDraw(); d2dContext->SetTarget(pBitmap); d2dContext->Clear(D2D1::ColorF(0, 0)); d2dContext->DrawLine(...); hr =

How to create a transparent bitmap in Direct2D

我是研究僧i 提交于 2021-02-07 08:22:20
问题 I need to create a transparent bitmap using Direct2D and draw, by using my device context, on it. ID2D1DeviceContext1* d2dContext = ... ID2D1Bitmap* pBitmap; d2dContext->CreateBitmap( bitmapSize, nullptr, 0, D2D1::BitmapProperties1( D2D1_BITMAP_OPTIONS_TARGET, D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED), dpiX, dpiY), &pBitmap); d2dContext->BeginDraw(); d2dContext->SetTarget(pBitmap); d2dContext->Clear(D2D1::ColorF(0, 0)); d2dContext->DrawLine(...); hr =

transparent window using Windows Composition engine in c++

ⅰ亾dé卋堺 提交于 2021-01-28 06:21:56
问题 First, I want to say that I am a newbie in direct2d usage. My final purpose is to have per pixel transparent window. I have found this nice article : https://docs.microsoft.com/en-us/archive/msdn-magazine/2014/june/windows-with-c-high-performance-window-layering-using-the-windows-composition-engine and it seems that it answers my question. Before writing my per-pixel transparent window, I just tried to test the code in that link. But when I run the program, the disk that should be displayed

Direct2d with WPF over RDP

╄→尐↘猪︶ㄣ 提交于 2021-01-27 17:45:16
问题 I'm developing a C# application which uses SharpDx to render a map with Direct2d. This map get displayed with the D3DImage on a WPF host. On a local machine everything works fine but when I try to connect via Remote Desktop, the D3DImage loses its Backbuffer and the rendered image can't be displayed with WPF. I tried to enable the software fallback when I bind the Backbuffer. The result is that the application manages to render one image and then loses the backbuffer again. I also tried to

RenderTarget->GetSize not working

瘦欲@ 提交于 2021-01-05 08:59:05
问题 To learn myself Direct2D i'm following this example from the MSDN. I have however one issue. The call D2D1_SIZE_F rtSize = m_pRenderTarget->GetSize(); allways returns a size of 0,0 and in the debugger causes an exception on the DrawLine call. If I leave out the GetSize() call and fill in the D2D1_SIZE_F structure with valid values it works. The relevant code for initializing the render target is: RECT rc; GetClientRect(m_hwnd, &rc); D2D1_SIZE_U size = D2D1::SizeU( rc.right - rc.left, rc

Right justify text using SharpDX/Direct2D

夙愿已清 提交于 2020-06-01 07:17:58
问题 I have some code to draw some text: var textFormat = new SharpDX.DirectWrite.TextFormat(fontFactory, "Arial", SharpDX.DirectWrite.FontWeight.Bold, SharpDX.DirectWrite.FontStyle.Normal, SharpDX.DirectWrite.FontStretch.Condensed, 16.0f); renderTarget.DrawText("AC", textFormat, textRect, textBrush, DrawTextOptions.NoSnap); The text is drawn starting at the top-left of the target rectangle. Is there any way to right-justify the text? 回答1: The fourth entry for the google search "right justify text

CoCreateInstance of IWICImagingFactory

天涯浪子 提交于 2020-05-16 05:37:50
问题 I am running Visual Studio 2012 on my Windows 7 machine. When I run the SimpleDirect2dApplication found here : http://technet.microsoft.com/en-us/subscriptions/dd940321%28v=vs.85%29.aspx hr = CoCreateInstance( CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&m_pWICFactory) ); the CoCreateInstance fails with a "Class Not Registered" and the ptr to the factory is 0. Any help would be appreciated. 回答1: According to an answer in a Microsoft's forum a breaking change in the

ID3D11Texture2D to ID2D1Bitmap, is it possible?

你离开我真会死。 提交于 2020-05-11 03:04:10
问题 I am working on a extension to a game which only opens a HDC for addon developers to draw on. However, I have exhausted GDI+/Direct2D drawing possibilities that is fast enough for what I want to accomplish - image effects(Additive, Blend, Multiply Blend etc). I am well aware that Direct2D offers a effects toolkit however, that requires a platform update (for Windows 7) and that is not ideal at all. Hence I am left with only Direct3D. MSDN/Google Search offers lots of ways to do D2D -> D3D,