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
14
votes
1 answer

How GDI/GDI+ works without OpenGL or DirectX

Sorry if this is off-topic here. If so; please feel free to move it to the appropriate site. How does GDI/GDI+ render to the graphics card (display content on the screen) without the use of a lower-level API for communicating with the GPU such as…
bbosak
  • 5,353
  • 7
  • 42
  • 60
14
votes
4 answers

Taking screenshots in Windows Vista, Windows 7, with transparent areas outside the app region

I am trying to take a screenshot of an application and I would like to make the parts of the rectangle that are not part of the applications region be transparent. So for instance on a standard windows application I would like to make the rounded…
Steve Sheldon
  • 6,421
  • 3
  • 31
  • 35
14
votes
1 answer

Is it possible to prevent tearing artifacts when drawing using GDI on a window with DWM composition?

I am drawing an animation using double-buffered GDI on a window, on a system where DWM composition is enabled, and seeing clearly visible tearing onscreen. Is there a way to prevent this? Details The animation takes the same image, and moves it…
David
  • 13,360
  • 7
  • 66
  • 130
13
votes
7 answers

How do I use large bitmaps in .NET?

I'm trying to write a light-weight image viewing application. However, there are system memory limitations with .NET. When trying to load large bitmaps (9000 x 9000 px or larger, 24-bit), I get a System.OutOfMemoryException. This is on a Windows…
Reyhn
  • 997
  • 1
  • 11
  • 22
13
votes
2 answers

How to use GDI+ in C?

Disclaimer: I'm only getting started in C, so it's likely that I'm missing something obvious, or not thinking the right way! :) How exactly would I go about using GDI+ in pure C? As I understand it, GDI+ has wrapped objects made for C++, but…
Meta
  • 1,663
  • 2
  • 18
  • 29
13
votes
4 answers

Windows fonts not immediately useable in application after installing?

Whenever I install a new font on a Windows 2003 server, I can't use it immediately in my asp.net web application. The application gets the font through the CreateFontIndirect gdi32.dll win api, and then use this font to create a dynamic text image…
Carvellis
  • 3,992
  • 2
  • 34
  • 66
13
votes
3 answers

How to rotate Bitmap in windows GDI?

How would I go about rotating a Bitmap in Windows GDI,C++?
H4cKL0rD
  • 5,421
  • 15
  • 53
  • 74
12
votes
3 answers

RenderTargetBitmap GDI handle leak in Master-Details view

I have an app with a Master-Details view. When you select an item from the 'master' list, it populates the 'details' area with some images (created via RenderTargetBitmap). Each time I select a different master item from the list, the number of GDI…
Wilka
  • 28,701
  • 14
  • 75
  • 97
12
votes
3 answers

GDI - Can I use the new Windows 10 Segoe UI Emoji colored font with DrawText?

I'm creating a c++ project using Embarcadero RAD Studio (10.2 Tokyo starter) and the Windows GDI to draw text, via the DrawText() function. I recently saw that Windows 10 provides a new "Segoe UI Emoji" font, that potentially allows text functions…
Jean-Milost Reymond
  • 1,833
  • 1
  • 15
  • 36
12
votes
3 answers

Creating HBITMAP from memory buffer

I have an application which loads some blob data out of a database which can represent png formatted or raw binary data for various bitmaps and icons. This is being stored in a std::vector I'm using CImageList objects to display…
AJG85
  • 15,849
  • 13
  • 42
  • 50
12
votes
8 answers

Hunting down EOutOfResources

Question: Is there an easy way to get a list of types of resources that leak in a running application? IOW by connecting to an application ? I know memproof can do it, but it slows down so much that the application won't even last a minute. Most…
Marco van de Voort
  • 25,628
  • 5
  • 56
  • 89
12
votes
4 answers

Specifying DPI of a GDI Device Context

I have an application that generates metafiles (EMFs). It uses the reference device (aka the screen) to render these metafiles, so the DPI of the metafile changes depending on what machine the code is running on. Let's say my code is intending to…
Nicholas Piasecki
  • 25,203
  • 5
  • 80
  • 91
12
votes
4 answers

Why does GetObject return an BITMAP with null bmBits?

Context: I'm trying to take a screenshot of another window to feed it into OpenCV. I found some code on the web that should be able to convert a BITMAP to something OpenCV can work with. Unfortunately I ran into some trouble. Question: Why is the…
Borgleader
  • 15,826
  • 5
  • 46
  • 62
12
votes
2 answers

How to draw text with transparent background using c++/WinAPI?

How to draw text with transparent color using WinAPI? In usual way I used SetBkMode(hDC, TRANSPARENT), but now I need to use double buffer. In this way images draws correct, but text draws not correct (with black background). case WM_PAINT: { …
Alexander
  • 275
  • 2
  • 4
  • 13
11
votes
3 answers

What exactly is a Graphic Context?

What exactly is encapsulated by a Graphic Context (or Device Context in Windows)? The various definitions across the net agree that a context encapsulates the parameters for the various graphics operations. See: X11, Mac OS, Windows What is not…
Dimitrios Menounos
  • 545
  • 1
  • 6
  • 17