GDI + smoothing problem

I have a C ++ application that uses the Win32 API for Windows, and I have a problem with GDI + anti-aliasing when I don't know why this should be.

I have a custom control (custom window). When I receive the WM_PAINT message, I draw several polygons using FillPolygon on the graphics device. This graphics device was created using BeginPaint's HDC.

If the polygons appear on the screen, they, however, become sharper and not transparent, and only seem to be a few colors (maybe 256?). When I do the same in C # using the .NET interface in GDI +, it works fine, which leaves me wondering what is going on.

I am not doing anything special, this is a simple example that should work fine as far as I know. Am I doing something wrong?

Edit: Nevermind. This only happens through Remote Desktop, although the C # example does not work on Remote Desktop. The remote desktop is set to 32-bit color, so I don’t know what’s wrong with that.

+4
source share
2 answers

Hmm ... The filling options are determined by the target device. When working on a remote desktop, AFAIK Windows replaces the display driver to change the supported display features.

  • when drawing on wm_paint, you are actually drawing directly on the surface of the screen, while .net usually uses double buffering (draws into a bitmap image in memory and then flushes the entire bitmap).
  • There are some settings in gdi + that affect the quality of the drawing. maybe there are different default values ​​for screen, off-screen and remote coloring?
0
source

This only happens through Remote Desktop.

Many remote applications reduce color depth to reduce bandwidth requirements. Although I have not used Remote Desktop, this also happens with some VNC connections. I would check your RD server and client settings.

0
source

All Articles