Direct2D is a hardware-accelerated, immediate-mode, 2-D graphics API that provides high performance and high-quality rendering for 2-D geometry, bitmaps, and text. The Direct2D API is designed to interoperate well with GDI, GDI+, and Direct3D.
Questions tagged [direct2d]
738 questions
6
votes
1 answer
Direct2D - Emulating Color Keyed Transparent Bitmaps
I'm currently updating a Windows GDI application to use Direct2D rendering and I need to support "transparent" bitmaps via color-keying for backwards compatibility.
Right now I'm working with a HWND render target and a converted WIC bitmap source…

Carl
- 86
- 5
5
votes
1 answer
How does Skia or Direct2D render lines or polygons with GPU?
This is a question to understand the principles of GPU accelerated rendering of 2d vector graphics.
With Skia or Direct2D, you can draw e.g. rounded rectangles, Bezier curves, polygons, and also have some effects like blur.
Skia / Direct2D offer CPU…

eikuh
- 673
- 1
- 9
- 18
5
votes
2 answers
GDI rendering to direct2D ID2D1BitmapRenderTarget is always transparent
I want to port my movie rendering software from DirectDraw to Direct2D. Because of compatibility issues, GDI rendering needs to be done on top of the image. To optimize performance I want to implement some kind of backbuffer mechanism, but there…

Norb
- 51
- 1
- 3
5
votes
2 answers
Direct2D : Unhandled Exception In WM_RESIZE switch case
I am creating a Simple Direct2D Application. Unfortunately it is giving
an unhandled exception. The function where it is taking place:
void DemoApp::OnResize(UINT width, UINT height)
{
if (m_pRenderTarget) <----|****The exception occurs…

Dhannanjai
- 650
- 1
- 8
- 18
5
votes
1 answer
Direct2D fails when drawing a single-channel bitmap
I'm an experienced programmer specialized in Computer Graphics, mainly using Direct3D 9.0c, OpenGL and general algorithms. Currently, I am evaluating Direct2D as rendering technology for a professional application dealing with medical image data. As…

MisterX
- 51
- 2
5
votes
2 answers
How to create a transparent bitmap in Direct2D
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,
…

Nick
- 10,309
- 21
- 97
- 201
5
votes
5 answers
Direct2D / GDI+ and slow Windows forms drawing - What can be done?
I'm working a lot with Visual Studio 2008, .NET C# 2.0-3.5 and Windows Forms and I have noticed, like many before me, that GDI+ is extremely slow in drawing Controls. Note that I do not deal with images (JPG, GIF etc) very much. Images are only as…

Ted
- 19,727
- 35
- 96
- 154
5
votes
2 answers
How should I handle the update rect/region/area in a Direct2D application?
In a traditional Windows program that uses GDI for graphics, you would have to worry about only drawing the area of the window that needs to be redrawn; this is the "update rect" and is accessed either by PAINTSTRUCT.rcPaint or by a call to…

andlabs
- 11,290
- 1
- 31
- 52
5
votes
3 answers
Why don't Direct2D and DirectWrite use traditional COM objects?
I'm toying with a little 2D game engine in C# and decided to use Direct2D and DirectWrite for rendering. I know there's the Windows API Code Pack and SlimDX, but I'd really like to dig in and write an interface from scratch. I'm trying to do it…

David Brown
- 35,411
- 11
- 83
- 132
5
votes
1 answer
System.Drawing (GDI+) vs System.Windows.Media (WPF) vs Direct2D+DirectWrite+WIC
For a Desktop Vista+ application that processes images, and is to be written in C#, which of the following technologies (or combinations_ would you recommend: System.Drawing (GDI+) vs System.Windows.Media vs Direct2D+DirectWrite+WIC. Image…

Fit Dev
- 3,413
- 3
- 30
- 54
5
votes
1 answer
What does "1" in "D2D1" stands for?
D2D1 is the namespace for Direct2D technology in Win32. However I don't understand the etymology of this name. The D2D part most likely refers to Direct2D, however the last 1 puzzles me...
There are also a lot of classes with "1" as a suffix:…

Pasha
- 6,298
- 2
- 22
- 34
5
votes
1 answer
How to perform high quality bitmap scaling in Direct2D?
I am trying to move an application from GDI+ to Direct2D for performance reasons.
Perviously I was using StretchBlt() in HALFTONE mode which gives great, but slow results.
Now I am drawing in Direct2D with RenderTarget->DrawBitmap() but it only has…

Ian Smith
- 51
- 1
- 2
5
votes
4 answers
Using Direct2D to draw on Direct3D11 surface
I am trying to create a Media Foundation Transform that draws text on video using D2D and D3D11. I am trying to construct a D2D RenderTarget on top of D3D11 resources, but unfortunately, most means of D2D and D3D interop require D3D10, which is not…

Zach
- 998
- 1
- 9
- 26
4
votes
1 answer
Direct2D Rendering to Commandlist and Printing: Picture Compression
I have a Win32 Direct2D application in which the user can draw primitives as well as load and manipulate pictures to create scenery. Afterward, the scenery can be printed or saved as a PDF file.
The process of printing D2D contents is explained by…

CptnAnalysis
- 51
- 3
4
votes
2 answers
What are the best practices for multithreading with Direct2D & DXGI (D3D interop)?
Ideally I'd like to have multiple worker threads to be able to render to off-screen render targets and then 'transfer' the rendered content to the on-screen target. With hwnd render targets this does not seem to be a problem (msdn has an example of…

Dan
- 41
- 1
- 3