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
9
votes
3 answers

how do I do print preview in win32 c++?

I have a drawing function that just takes an HDC. But I need to show an EXACT scaled version of what will print. So currently, I use CreateCompatibleDC() with a printer HDC and CreateCompatibleBitmap() with the printer's HDC. I figure this way the…
Stephen Hazel
  • 859
  • 2
  • 12
  • 27
9
votes
3 answers

How to handle WM_ERASEBKGND to avoid flickering?

I have on a form some custom progress bars which are updated/refreshed twice per second and they are flickering. TMyProgressBar = class(TCustomControl) I inherited the control from TCustomControl, because I needed Handle and some TWinControl…
ALZ
  • 1,997
  • 2
  • 27
  • 44
9
votes
1 answer

How to draw a string without padding

I am using the GraphicsPath.AddString() function, but it draws the text with a little space around the text. Any idea how to draw the string without that padding, only the paths of the text? My code is like this: GraphicsPath gp = new…
MHMr
  • 119
  • 1
  • 2
9
votes
2 answers

How to get list of GDI handles

I'm trying to write, using DLL injection method, application which displays bitmaps used by another program and I want to get for this specific process list of GDI Handles which it is using (list like in GDIView.exe utility). I found article about…
cadaver
  • 245
  • 2
  • 11
9
votes
5 answers

Transparency to text in GDI

i have created a Bitmap using GDI+.I am drawing text on to that bitmap using GDI Drawtext.Using Drawtext i am unable to apply tranparency. Any help or code will be appreciated.
VideoDev
  • 111
  • 2
  • 7
9
votes
11 answers

Heisenbug: WinApi program crashes on some computers

Please help! I'm really at my wits' end. My program is a little personal notes manager (google for "cintanotes"). On some computers (and of course I own none of them) it crashes with an unhandled exception just after start. Nothing special about…
Alex Jenter
  • 4,324
  • 4
  • 36
  • 61
9
votes
3 answers

Is GDI+ just a layer on top of GDI, or something new?

When GDI+ came out, I remember all the brouhaha about how it was the "new, faster, better" way to display stuff in Windows. But everytime I looked at it, it seemed to me that it was really just a COM wrapper around GDI. Is that true? Or is GDI+…
Euro Micelli
  • 33,285
  • 8
  • 51
  • 70
9
votes
2 answers

Draw Slightly Transparent Blue Rectangle in Native Win32 GDI

How do I draw a blue rectangle with a alpha/transparency value of 0.5 (ie, 50% transparency) in Native Win32 C++? Using a macro like RGBA() fails, I'm not sure how I can specify the alpha value of the brush. SetDCPenColor(hdc,…
sazr
  • 24,984
  • 66
  • 194
  • 362
9
votes
1 answer

How to color blend (colorize by specified alpha value) the canvas area using pure GDI?

I'd like to color blend (colorize by specified alpha value) the area of a canvas using pure Windows GDI (so without GDI+, DirectX or similar, no OpenGL, no assembler or a 3rd party libraries). I've created the following function and I'd like to know…
TLama
  • 75,147
  • 17
  • 214
  • 392
8
votes
2 answers

Are the GDI functions BitBlt and StretchBlt hardware accelerated in Win32?

I can't seem to get a definite answer to this via searching. Are the Win32 blitting operations hardware accelerated (GDI, not GDI+). I don't know how these functions interface with the graphics driver. Is there any function call to verify this…
oldSkool
  • 1,212
  • 5
  • 14
  • 29
8
votes
2 answers

How to determine the size of the button portion of a Windows radio button

I'm drawing old school (unthemed - themed radios are a whole other problem) radio buttons myself using DrawFrameControl: DrawFrameControl(dc, &rectRadio, DFC_BUTTON, isChecked() ? DFCS_BUTTONRADIO | DFCS_CHECKED : DFCS_BUTTONRADIO); I've never been…
Aardvark
  • 8,474
  • 7
  • 46
  • 64
8
votes
3 answers

D3D11: How to draw GDI Text to a GXDI Surface? (Without D2D)

I need some help with drawing a text to a texture with GDI and D3D11. I tried using D2D/DirectWrite, but it supports just D3D10 and not D3D11 as I need. Everything I tried failed so far... Now I want to use GDI methodes to write in the texture. So I…
sandicz
  • 326
  • 3
  • 9
8
votes
2 answers

How to add text to icon in c#?

I want to display an icon [a .ico file] in System tray with some text added to it at runtime. Is there any native WPF way to do it? or snippet for GDI+ also would be grateful. Thank you.
iraSenthil
  • 11,307
  • 6
  • 39
  • 49
8
votes
1 answer

Detect if a window is using hardware-accelerated graphic context

I'm using BitBlt winapi function to take a screenshot of a given window, even if the window is partially overlapped. I have everything working fine already, except that, on Windows 10, for some windows (like the Edge browser) the screenshot turns…
Tim
  • 81
  • 3
8
votes
1 answer

How to tell if a surrogate pair Unicode character is supported by the font?

I was able to find the following method of determining if a Unicode-16 character is supported by a font. Unfortunately that doesn't work for surrogate pair Unicode characters, since WCRANGE struct supported by GetFontUnicodeRanges function returns…
c00000fd
  • 20,994
  • 29
  • 177
  • 400