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

What unnamed GDI resources could I be leaking

I ran an overnight stress test of my application, and when i came in this morning the software had crashed from a Windows error. The error occurred because the process was obviously out of GDI handles: Process Explorer Task Manager The next thing…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
5
votes
3 answers

Create a special visual selection tool for Image

I want to create a special kind of selection, in which the image darkened and in part which user is selecting, the real Image is shown. You can see an Example: I found two approaches for implementing this: Implementing a control which show the…
bman
  • 5,016
  • 4
  • 36
  • 69
5
votes
1 answer

Screen capture fails to capture whole screen using C++ and GDI

I made some research through the web, and found some useful code. I changed it a bit, in attempt to capture the whole screen and generate a buffer that I can send through udp packets: #include #include #include void…
W2a
  • 736
  • 2
  • 9
  • 23
5
votes
2 answers

How to create a quality splash screen odd shaped like VS 2010?

I've seen some neat splash screens like VS 2010, Adobe products, etc. I know in VS.NET you can set a transparency color, etc. but I have never been able to make one look nice that didn't have some type of jagged edges or color issues on the edges. …
Neal
  • 9,487
  • 15
  • 58
  • 101
5
votes
1 answer

What is the HDC for in GetDIBits?

I was using GetDIBits to get bitmap data from a screen compatible device context into a DIB of a certain format. I was under the impression that the DC was necessary only for synthesizing a color table when the source bitmap is 8 bits-per-pixel or…
Adrian McCarthy
  • 45,555
  • 16
  • 123
  • 175
5
votes
0 answers

GDI SetWindowRgn is extremely slow for complex window shapes

Our application creates an overlay window of a custom shape using the SetWindowRgn() API in its OnPaint() function. This region window only has a client area. It also has an owner window which is a regular rectangular window. We have observed that…
Kapil Dhaimade
  • 312
  • 2
  • 12
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

Setting the Line End Styles for Canvas.LineTo

Is there any way to set the style for the lineends for the TCanvas.LineTo method? It seems to default to rounded ends, which looks very bad for several lines in a row of different colours when Pen.Width is set to a large value (e.g. 9). It looks…
Thomas Mueller
  • 282
  • 5
  • 8
5
votes
1 answer

How to render a font from privatefontcollection memory to editable controls

This is a continuation of Loading a font from resources into PrivateFontCollection results in corruption The answer supplied here is sufficient for controls that have the UseCompatibleTextRendering method available, however it does not appear to be…
Kraang Prime
  • 9,981
  • 10
  • 58
  • 124
5
votes
6 answers

How to detect if loading an image will throw an OutOfMemory exception in .NET?

I have an application written using .NET 3.5 SP1 that downloads images from an external site and displays them to end users. On rare ocassions, my users are experiencing OutOfMemory errors because they are downloading enormous images. Sometimes the…
Keith
  • 141
  • 7
5
votes
0 answers

Given just a HBITMAP, how to draw to it?

I'm an absolute beginner at this but have managed to blunder my way to 93% of where I want to be. Need help for the final 7%. I've manually created a bitmap like so: BITMAPINFO bmpInfo = { 0 }; BITMAPINFOHEADER bmpInfoHeader = { 0 }; BITMAP…
pgg
  • 49
  • 2
5
votes
1 answer

Stable random color algorithm

Here we have an interesting real-world algorithm requirement involving colors. N Pretty Colors: In order to draw a beautiful chart (i.e: pie chart) we need to pick a random set of N colors that are "different enough" and look good together. This…
Olmo
  • 4,257
  • 3
  • 31
  • 35
5
votes
1 answer

Drawing by Windows GDI inside of Qt

I am trying to use Windows GDI inside of QGraphicsView paintEvent but have noticed some drawing issues, for example the drawing disappear or blinking when I resize window or minimize and maximize. When I use Qt instead of GDI its working perfectly.…
IKM2007
  • 716
  • 1
  • 8
  • 31
5
votes
1 answer

Is there a difference in disposing Icon and Bitmap?

I was debugging resource leaks in my application and created a test app to test GDI object leaks. In OnPaint I create new icons and new bitmaps without disposing them. After that I check the increase of GDi objects in task manager for each of the…
username
  • 3,378
  • 5
  • 44
  • 75
5
votes
1 answer

StretchBlt is too slow, anyway faster?

I'm using StretchBlt to draw a resized real-time video. ::SetStretchBltMode(hDC, HALFTONE); ::StretchBlt(hDc, 0, 0, 1225, 689, hwNd, 0, 0, 1364, 768, SRCCOPY); However, the StretchBlt api is too slow. It's take about 100ms on my computer…
LeDuc
  • 245
  • 2
  • 9