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

C# Drawing on Panels

I'm drawing up a day schedule and representing timeslots with panels, and appointments are yet more panels on top. The user is able to scroll up and down so that the range they can see is shifted earlier or later. When an appointment runs off the…
Ozzah
  • 10,631
  • 16
  • 77
  • 116
11
votes
2 answers

GraphicsPath AddString not support enough to the font when use right to left language if operating system lower than Win10

I need to generate an image from a string in my WPF application, and show it. Here is my code: // Create Image and generate string on it System.Windows.Controls.Image img = new System.Windows.Controls.Image(); // This is the font that I need to…
qakmak
  • 1,287
  • 9
  • 31
  • 62
11
votes
1 answer

What does SelectObject(dc, hBMP) do?

I guess I do understand what happens if I select "an object" into a "device contect", and if this object is a brush, font, pen: The charactersicts of these objects are hence forth used for the drawing onto the device context. However, I don't…
René Nyffenegger
  • 39,402
  • 33
  • 158
  • 293
11
votes
1 answer

C++ Drawing directly to the screen (like an overlay)

Many laptops nowadays have FN hot keys to change volume, brightness, etc. and usually display a visual cue that is rendered on the screen completely above the operating system. For new Windows 8/8.1 systems this visual even appears outside of the…
Bradley Odell
  • 1,248
  • 2
  • 15
  • 28
11
votes
1 answer

Confused between logical coordinates and device coordinates in Windows API

I have been looking into a Visual Studio C++ Windows application project which used two functions SetWindowExt (...) and SetViewportExt (...). I am confused about what these two functions do and why they are necessary. Searching about these…
Viku
  • 2,845
  • 4
  • 35
  • 63
11
votes
11 answers

A generic error occurred in GDI+

[ExternalException (0x80004005): A generic error occurred in GDI+.] IpitchitImageHandler.Data.ImageRepository.AddNewTempImage(Stream image, String extension, Guid PageId, Guid ImageId, ImageTransformCollection toDoTransforms) +1967 …
Vjeran
  • 141
  • 1
  • 1
  • 6
10
votes
4 answers

Winforms: How to speed up Invalidate()?

I'm developing a retained mode drawing application in GDI+. The application can draw simple shapes to a canvas and perform basic editing. The math that does this is optimized to the last byte and is not an issue. I'm drawing on a panel that is using…
Pedery
  • 3,632
  • 1
  • 27
  • 39
10
votes
1 answer

CreateCompatibleBitmap and CreateDIBSection (Memory DC's)

from what I've read here it seems that most of the Windows GDI functions are accelerated. So for instance a call to BitBlt or AlphaBlend uses hardware acceleration if available. It also mentions that the contents of a window are kept only in video…
demorge
  • 1,097
  • 1
  • 7
  • 17
10
votes
4 answers

Disable antialiasing for a specific GDI device context

I'm using a third party library to render an image to a GDI DC and I need to ensure that any text is rendered without any smoothing/antialiasing so that I can convert the image to a predefined palette with indexed colors. The third party library i'm…
Jacob Stanley
  • 4,704
  • 3
  • 33
  • 36
10
votes
4 answers

How to generate a monochrome bit mask for a 32bit bitmap

Under Win32, it is a common technique to generate a monochrome bitmask from a bitmap for transparency use by doing the following: SetBkColor(hdcSource, clrTransparency); VERIFY(BitBlt(hdcMask, 0, 0, bm.bmWidth, bm.bmHeight, hdcSource, 0, 0,…
Mordachai
  • 9,412
  • 6
  • 60
  • 112
10
votes
2 answers

OpenGL stereo in layered window

Is anybody aware of a way to enable OpenGL stereo while using a layered window in Windows 7?
paj7777
  • 311
  • 1
  • 4
  • 13
10
votes
1 answer

C++/Win32: How to get the alpha channel from an HBITMAP?

I have an HBITMAP containing alpha channel data. I can successfully render this using the ::AlphaBlend GDI function. However, when I call the ::GetPixel GDI function, I never get back values with an alpha component. The documentation does say that…
mackenir
  • 10,801
  • 16
  • 68
  • 100
10
votes
4 answers

How to find the EXACT pixel height of text rendered in Windows using DrawText

I wish to find the exact height of text rendered in Windows. I have tried both GetTextExtentPoint32 and calling DrawText with the DT_CALCRECT flag and both give the same result. It seems that the height returned is based on the full cell height,…
Anthony Wild
  • 137
  • 5
10
votes
2 answers

Invalidating non-client areas

I've a window which has custom border/caption, in order to do that I handle WM_NCPAINT message. My caption has two backgrounds a brighter one for the active window, and a darker one for the background window. But under some circumstances, for…
Ismael
  • 2,995
  • 29
  • 45
10
votes
3 answers

Win32: Is there a replacement GDI32.dll that uses hardware acceleration?

Has anyone out there created a version of GDI32.dll that takes advantage of hardware acceleration available on the machine? gdiplus.dll? Starting with Windows Vista, GDI is no longer hardware accelerated. (GDI+ was never hardware accelerated).…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219