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
22
votes
2 answers

Rotate a point around another point

I have a task to draw a specific graphic. As part of this task I need to rotate some dot's on 45 degrees. I've spent already 2 days trying to calculate a formula, but just couldn't get it right. I've been searching all over the place including this…
Allan Spreys
  • 5,287
  • 5
  • 39
  • 44
18
votes
4 answers

Graphics.DrawString vs TextRenderer.DrawText?Which can Deliver Better Quality

TextRenderer is based on GDI and Graphics.DrawString is based on GDI+.Which of these functions can deliver better quality text while drawing text on an image.
techno
  • 6,100
  • 16
  • 86
  • 192
18
votes
3 answers

DrawText VS TextOut Win32

I find have used both these functions before, but I don't quite see the the difference between them. Well, I know that DrawText requires a formatting rectangle,and can do some text formatting, and textout only the starting coordinates, are there any…
devjeetroy
  • 1,855
  • 6
  • 26
  • 43
18
votes
4 answers

About GDI/GDI+ coordinate compatibility?

I have a problem while drawing with both GDI and GDI+ interchangeably. The page transformation—in particular scaling—seems to be a little bit off between the two. Which properties of the GDI context affects the scaling of the output other than…
Yngve Hammersland
  • 1,634
  • 2
  • 14
  • 28
18
votes
4 answers

Screen Capture Specific Window

Is it possible to screen capture a specific window (also possibly of another process)? Currently I am capturing the entire desktop of a specific monitor, however what I truly want is to capture the content of a specific window (regardless of its…
ronag
  • 49,529
  • 25
  • 126
  • 221
17
votes
5 answers

C# WinForms - Anyone know of a C# GDI library not SLOW GDI+

GDI+ is very slow, almost entirely software whereas GDI is highly hardware accelerated. GDI+ is what the Graphics class uses on WinForms and it's just too slow. Has anyone made a .NET GDI library so we can have the speed? [EDIT] Many people are…
Joe
  • 964
  • 1
  • 10
  • 27
17
votes
4 answers

What is the difference between GDI and GDI+?

Are there any differences between those two libraries?
user496949
  • 83,087
  • 147
  • 309
  • 426
17
votes
3 answers

Why not use GDI to repeatedly fill a window with RGB data from an array?

This is a follow-up to this question. I'm currently writing a simple game and am looking for the fastest way to (repeatedly) display an array of RGB data in a Win32 window, without flickering or other artifacts. Several different approaches were…
user200783
  • 13,722
  • 12
  • 69
  • 135
16
votes
2 answers

c# radial gradient brush effect in GDI and winforms

I have created a c# windows application and written 75% of the code. The program allows the user to create a flow chart, and will shade the flow chart shapes according to their status. I wanted them to become 3d buttons such as from the website…
ClimberM
  • 319
  • 1
  • 4
  • 10
16
votes
6 answers

How to find out DC's dimensions?

Let's say I have a handle to device context (naturally, in Windows environment): HDC hdc; How can I get the width and height of it?
nhaa123
  • 9,570
  • 11
  • 42
  • 63
16
votes
1 answer

GDI handle leak using TGIFImage in a second thread

I have a background thread which loads images (either from disk or a server), with the goal of eventually passing them to the main thread to draw. When this second thread is loading GIF images using the VCL's TGIFImage class, this program sometimes…
David
  • 13,360
  • 7
  • 66
  • 130
15
votes
3 answers

How can I render a square bitmap to an arbitrary four-sided polygon using GDI?

I need to paint a square image, mapped or transformed to an unknown-at-compile-time four-sided polygon. How can I do this? Longer explanation The specific problem is rendering a map tile with a non-rectangular map projection. Suppose I have the…
David
  • 13,360
  • 7
  • 66
  • 130
15
votes
4 answers

How to effectively draw on desktop in C#?

I want to draw directly on the desktop in C#. From searching a bit, I ended up using a Graphics object from the Desktop HDC (null). Then, I painted normally using this Graphics object. The problem is that my shapes get lost when any part of the…
Lazlo
  • 8,518
  • 14
  • 77
  • 116
14
votes
5 answers

SetPixel is too slow. Is there a faster way to draw to bitmap?

I have a small paint program that I am working on. I am using SetPixel on a bitmap to do that drawing of lines. When the brush size gets large, like 25 pixels across there is a noticeable performance drop. I am wondering if there is a faster way to…
Pyro
  • 339
  • 1
  • 4
  • 12
14
votes
2 answers

How can I find what font was actually used for my CreateFont call?

In Windows, the CreateFontIndirect() call can silently substitute compatible fonts if the requested font is not requested. The GetObject() call does not reflect this substitution; it returns the same LOGFONT passed in. How can I find what font was…
bdonlan
  • 224,562
  • 31
  • 268
  • 324