Questions tagged [gdi]

Graphics Device Interface (GDI) is a device-independent, pure software graphics API under the Windows operating system for drawing graphic primitives and text. It is the underlying base used to render the Windows GUI elements.

Graphics Device Interface (GDI) is a device-independent, pure software graphics API under the Windows operating system for drawing graphic primitives and text. It is the underlying base used to render the Windows GUI elements.

More information at http://en.wikipedia.org/wiki/Graphics_Device_Interface

2158 questions
5
votes
1 answer

How to speed up BitBlt to capture screen with aero?

I use following code to capture the screen with GDI functions: // Prologue: int iScreenWidth = GetSystemMetrics(SM_CXSCREEN); int iScreenHeight = GetSystemMetrics(SM_CYSCREEN); HDC hScreenDC = GetDC(0); HDC hCaptureDC =…
TX_
  • 51
  • 1
  • 2
5
votes
1 answer

Why does DrawImageUnscaled cause flickering when used from WM_NCPAINT?

I'm currently building a control derived from System.Windows.Forms.ContainerControl that has a border area I need to paint myself. Since there's no OnPaintNonClientArea to override, I built it myself like this (handling of other messages like…
takrl
  • 6,356
  • 3
  • 60
  • 69
5
votes
1 answer

Transparent Ellipse

How do you draw a transparent ellipse with GDI? I tried SetBkMode() but I still get a white ellipse bk. case WM_PAINT: { hdc = BeginPaint(hwnd, &ps); SetBkMode(hdc, TRANSPARENT); // doesnt work Ellipse(hdc, 0,0,500,500); …
Geore Shg
  • 1,299
  • 5
  • 23
  • 38
5
votes
1 answer

How to intercept mouse events of a transparent window?

I have a transparent window (created with WS_EX_LAYERED) and I'd like to receive mouse events of the zero-alpha regions. As far as I know, I could: 1) Use mouse hook 2) Paint the background with almost completely transparent color (that has an…
Omer
  • 661
  • 7
  • 21
5
votes
1 answer

Confusion in two MFC GDI function

and good day to all of you. This is my first post in here. I was reading "Programming Windows with MFC - J Prosise (MS Press)" In second chapter I came across 2 GDI functions that really confused me, I am quoting the text: It's easy to get…
Razort4x
  • 3,296
  • 10
  • 50
  • 88
5
votes
2 answers

Is CreateCompatibleDC() necessary working with windows on one display?

This example code manually reads a bitmap file, uses CreateDIBSection() to make GDI allocate memory for it, and create an hbitmap handle. Then it uses a MemoryDC to draw the bitmap to a window…
user10530562
  • 149
  • 2
  • 8
5
votes
4 answers

Win32 CreatePatternBrush

MSDN displays the following for CreatePatternBrush: You can delete a pattern brush without affecting the associated bitmap by using the DeleteObject function. Therefore, you can then use this bitmap to create any number of pattern …
Luther Baker
  • 7,236
  • 13
  • 46
  • 64
5
votes
1 answer

WPF: Use font installed with 'AddFontMemResourceEx' for process only

In WPF we would like to use ttf fonts as embedded resources without copying or installing these to the system and without actually writing these to disk. Without memory leak issues. None of the solutions detailed in: How to include external font in…
nietras
  • 3,949
  • 1
  • 34
  • 38
5
votes
1 answer

GDI rendering to WPF window

I've done some searching, but I can't find an exact answer on this. In my C# WPF app, I get the HWND pointer and pass it to a C dll. That C dll then attempts to use GDI calls to render an overlay of sorts on my window. There are no errors, but…
Arian Kulp
  • 831
  • 8
  • 31
5
votes
0 answers

Detecting fast user switch events from an application running on an RDP session (RDP window minimize)

I'm working on an application that records the screen and it should support terminal services, The problem is actually when the RDP window is minimized the user session goes into UI less mode and there is no screen to capture for the application…
iamrameshkumar
  • 1,328
  • 1
  • 14
  • 34
5
votes
2 answers

Monitoring GDI calls

Is there a tool that allows one to monitor GDI calls?
Mike
  • 1,760
  • 2
  • 18
  • 33
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
1 answer

Clickthrough to desktop on a transparent form

I have a screen capturing utility on which I can rubber band an area on the desktop. I've done this is a fairly easy manner, I have a form which is the same size as the screen on which I draw a screenshot of the desktop transformed into grayscale.…
Tamas Henning
  • 141
  • 1
  • 7
5
votes
2 answers

What could be the reason for AlphaBlend to return 'false'

I am trying to stretch an HBITMAP with alpha and draw it to anther hdc. I'm using StretchDIBits and then AlphaBlend, as shown in the code below. The problem is that AlphaBlend fails and returns false. 1. Does anyone knows what could be the…
tal
  • 281
  • 3
  • 7
5
votes
2 answers

windows 10 screen coordinates are offset by 7

I'm coding in c++ on windows 10 - straight win32 API. I wanted to make a window show up in the top right of the screen. As I was doing this, I noticed that screen coordinates for a maximized window are left=-8, top=-8, right=1936, bottom=1088. Also,…
Stephen Hazel
  • 859
  • 2
  • 12
  • 27