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

2006 questions
60
votes
5 answers

Problem reading JPEG Metadata (Orientation)

I've got a JPEG image which was taken on an iphone. On my desktop PC (Windows Photo Viewer, Google Chrome, etc) the orientation is incorrect. I'm working on an ASP.NET MVC 3 web application where i need to upload photos (currently using…
RPM1984
  • 69,608
  • 55
  • 212
  • 331
48
votes
2 answers

Enumerating monitors on a computer

I have found 7 different ways to enumerate the monitors attached to the computer. But all solutions give different results (number of the monitors and information on each monitor). These solutions are: Using the famous EnumDisplayDevices Using…
Cédric Bignon
  • 11,982
  • 3
  • 35
  • 50
31
votes
4 answers

What is the difference between GetClientRect and GetWindowRect in WinApi?

What of these should I use in InvalidateRect to refresh my window? And why?
Abzac
  • 2,451
  • 5
  • 19
  • 24
30
votes
5 answers

How to get the exact text margins used by TextRenderer

System.Windows.Forms.TextRenderer.DrawText method renders formatted text with or without left and right padding depending on the value of the flags parameter: TextFormatFlags.NoPadding - fits the text tightly into the bounding…
Jacek Mokrzycki
  • 321
  • 3
  • 6
28
votes
2 answers

How to capture the screen with the "Tool Tips"?

I am using GDI to capture the screen, and I have noticed that the "Tool Tips" are not included in the screenshot. This is my basic code: HDC hdcDesk = GetDC(0); HDC hdcMem = CreateCompatibleDC(hdcDesk); HBITMAP hbmMem =…
paul
  • 515
  • 4
  • 14
25
votes
5 answers

How would I load a PNG image using Win32/GDI (no GDI+ if possible)?

Is it possible to load a PNG from a file into an HBITMAP using Win32 GDI functions? If not, what would be the lightest solution without using external libraries (like libpng)?
jnm2
  • 7,157
  • 5
  • 57
  • 92
25
votes
3 answers

Is it possible to detect GDI leaks from the Visual Studio debugger?

Leaking GDI objects can be seen from the task manager or from Process Explorer. (Well you don't see the leaks, but you can see if object uasage count continually goes up.) There are also tools that allow to view GDI objects by type, such as…
Martin Ba
  • 33,741
  • 27
  • 150
  • 304
24
votes
5 answers

Printing on roll paper

I am using C# with Winforms. I am trying to print bills on a paper roll. The width of the paper is 3in but the length of the paper is dynamic (its a roll paper). The length depends on how many items are there in the list. E.g. in a purchase if there…
Thunder
  • 9,267
  • 24
  • 75
  • 112
22
votes
4 answers

Is TDirect2DCanvas slow or am I doing something wrong?

While looking for alternatives to replace GDI, I was trying to test Delphi's 2010 TDirect2DCanvas performance in Windows 7. I tested it by drawing a huge polyline using Direct2D and the result was absurdly slow, even with 500 times less data than…
Trinidad
  • 2,630
  • 1
  • 21
  • 42
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…
Vlad Spreys
  • 4,239
  • 4
  • 35
  • 41
22
votes
6 answers

Are GDI, GDI+ and OpenGL really obsolete/deprecated?

If you open the page "Graphics and Gaming (Windows)" on microsoft.com the last category is described as Legacy Graphics: Technologies that are obsolete and should not be used in new applications. This category includes (among others) the…
RED SOFT ADAIR
  • 11,294
  • 10
  • 48
  • 83
21
votes
1 answer

Why can't DirectX/DirectWrite/Direct2D text rendering be as sharp as GDI?

I already know that sub-pixel positioning causes DirectWrite text rendering to be blurry compared to GDI. However, my question is a bit more fundamental: Why can't DirectWrite (and related methods) be made to render text as sharply as GDI? In other…
user541686
  • 189,354
  • 112
  • 476
  • 821
21
votes
5 answers

JPEG 2000 support in C#.NET

It seems that .NET can't open JP2 (Jpeg 2000) files using the GDI library. I've searched on google but can't find any libraries or example code to do this. Anybody got any ideas? I don't really want to pay for a library to do it unless I have to..
Gordon Thompson
  • 4,464
  • 8
  • 45
  • 60
19
votes
3 answers

What's the upper limit on GDI objects for one process in Windows 7?

Have an application with a GDI leak that will eventually hit 10,000 allocated GDI objects and crash. I tried increasing the GDIProcessHandleQuota to 20,000, but the program still crashed when it reached 10,000 objects. We're currently working on…
Micky
  • 315
  • 1
  • 4
  • 13
19
votes
6 answers

How to record a specific window using ffmpeg?

I use ffmpeg to record a window using this code: ffmpeg.exe -f dshow -y -i video="screen-capture-recorder":audio="virtual-audio-capturer":audio="Microphone (USB Audio Device)" -framerate 15 -vcodec libx264 -crf 0 -preset ultrafast -acodec…
Matin Lotfaliee
  • 1,512
  • 1
  • 18
  • 39
1
2 3
99 100