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

Is StretchBlt HALFTONE == BILINEAR for all scaling?

Can anyone clarify if the GDI StretchBlt function for the workstation Win32 API performs bilinear interpolation for scaling to both larger and smaller images for 24/32-bit color images? And if not, is there a GDI (not GDI+) function that does…
holtavolt
  • 4,378
  • 1
  • 26
  • 40
6
votes
4 answers

What's the fastest way to repeatedly fill a window with RGB data from an array?

I'm currently writing a simple game. My graphics code runs once per frame (approximately 30 times per second), and writes RGB data to an array with 640 * 480 = 307200 entries. I have created a Win32 window with a client area exactly 640 x 480 pixels…
user200783
  • 13,722
  • 12
  • 69
  • 135
6
votes
0 answers

BitBlt not capturing windows in Hardware accelerated mode

I'm currently working on capturing window snapshots using GDI32.dll though I'm having an issue with Hardware Accelerated Windows that I was wondering if there was a way to circumvent. I found this amazing bit of code here: public static Image…
Ozzadar
  • 518
  • 1
  • 3
  • 10
6
votes
2 answers

How are GDI+ functions so fast?

I am trying to recreate very simple GDI+ functions, such as scaling and rotating an image. The reason is that some GDI functions can't be done on multiple threads (I found a work around using processes but didn't want to get into that), and…
Frobot
  • 1,224
  • 3
  • 16
  • 33
6
votes
0 answers

Numerical accuracy limitation in GDI?

I am drawing circular arcs using the Windows GDI function Arc. It takes for arguments the bounding box of the circle and two points that delimit the starting and ending angles (not the angles themselves). When I pass the arguments as below, I get an…
user1196549
6
votes
1 answer

Blur-behind window with titlebar in Windows 10? Stopped working after Windows Update

I'm trying to create a transparent window with a "glass" effect in Windows 10. This worked until recently: What I have been doing is: Paint to the target DC including an alpha channel. One way to do this in plain GDI is to construct an image with…
jdm
  • 9,470
  • 12
  • 58
  • 110
6
votes
1 answer

MSDN example for scrolling large image malfunctions

INTRODUCTION AND RELEVANT INFORMATION: I am trying to paint the image in my main window in its natural size. Currently I need to render EMF. After browsing through Internet, I found this MSDN example. PROBLEM: I have given it a try, and found out it…
AlwaysLearningNewStuff
  • 2,939
  • 3
  • 31
  • 84
6
votes
2 answers

Altering an embedded TrueType font so it will be usable by Windows GDI

I am trying to render PDF content to a GDI device context (a 24bit bitmap to be exact). Parsing the PDF stream into PDF objects and rendering the PDF commands from the content dictionary works well, including font rendering. Embedded fonts are…
Ritsaert Hornstra
  • 5,013
  • 1
  • 33
  • 51
6
votes
2 answers

Change colour filter of screen to work with multiple monitors

I've made a program to change the colour filter of the screen similar to the way Flux does (the code shown to do this is in the main question from here). However, a couple of my users say it won't affect the other screen/s with two or more monitors.…
Dan W
  • 3,520
  • 7
  • 42
  • 69
6
votes
2 answers

Strange error with CreateCompatibleDC

Maybe this is a foolish question, I can't see why I can not get a DC created in the following code : HBITMAP COcrDlg::LoadClippedBitmap(LPCTSTR pathName,UINT maxWidth,UINT maxHeight) { HBITMAP hBmp = (HBITMAP)::LoadImage(NULL, pathName,…
sevaxx
  • 691
  • 1
  • 7
  • 16
6
votes
3 answers

Need Help Setting an Image with Transparent Background to Clipboard

I need help setting a transparent image to the clipboard. I keep getting "handle is invalid". Basically, I need a "second set of eyes" to look over the following code. (The complete working project at ftp://missico.net/ImageVisualizer.zip.) This is…
AMissico
  • 21,470
  • 7
  • 78
  • 106
6
votes
1 answer

how to fill gradient for roundrect in pure gdi (not gdi+)

just in pure gdi. thoughts or code are all welcome.
lovespring
  • 19,051
  • 42
  • 103
  • 153
6
votes
7 answers

GDI handles in a DotNET application

My pure DotNET library runs as a plugin inside an unmanaged desktop application. I've been getting a steady (though low) stream of crash reports that seem to indicate a problem with GDI handles (fonts in error messages etc. revert to the system…
David Rutten
  • 4,716
  • 6
  • 43
  • 72
6
votes
2 answers

Combine a lot (~1000-2000) of Jpeg images into one

I'm using the following code right now, and it works for ~300 images, but I have to merge more than one thousand. private static void CombineThumbStripImages(string[] imageFiles) { int index = 0; using (var result = new Bitmap(192 *…
Tamás Varga
  • 635
  • 5
  • 17
6
votes
2 answers

Drawing video with text on top

I am working on an application and I have a problem I just cant seem to find a solution for. The application is written in vc++. What I need to do is display a YUV video feed with text on top of it. Right now it works correctly by drawing the text…
thecaptain0220
  • 2,098
  • 5
  • 30
  • 51