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
8
votes
1 answer

What would be a higher quality alternative to StretchBlt for drawing an HBITMAP?

I don't want to use GDI+'s DrawImage because of speed issues. What other ways are there to draw an image resized with decent quality - at least linear or cubic interpolation?
jnm2
  • 7,960
  • 5
  • 61
  • 99
8
votes
3 answers

Guidelines for Using Brushes and Pens

How expensive is it to create gdi brushes and pens? Should I create them on an add needed basis and wrap them in a using so they are disposed quickly, or should I create a static class similar to System.Drawing.Brushes class?
Bob
  • 97,670
  • 29
  • 122
  • 130
8
votes
2 answers

Do I need a WOW64 dump for GDI Handle analysis?

I'm debugging a potential GDI Handle Leak. Thanks to @Alois Kraus, there is a WinDbg script which performs a handle count. From my debugging sessions, especially for .NET, I find that usually, it's better to have 32-bit dumps of 32-bit processes and…
Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
8
votes
2 answers

HBRUSH to RGB value

Can you get the RGB value from HBRUSH or from brush id? for example: I'm looking for GRAY_BRUSH in RGB value.
xor
  • 93
  • 1
  • 4
8
votes
2 answers

How to Create a Gdiplus::Bitmap from an HBITMAP, retaining the alpha channel information?

When I create a new Gdiplus::Bitmap using the Bitmap::FromHBITMAP function, the resulting Bitmap is opaque - none of the partial transparency from the original HBITMAP is preserved. Is there a way to create a Gdiplus::Bitmap from an HBITMAP which…
mackenir
  • 10,801
  • 16
  • 68
  • 100
8
votes
3 answers

Sharing HDC between different processes

I am writing some kind of IPC functionality and need to pass certain resources from one process to another. This works well for Pipe handles etc. which can be duplicated via DuplicateHandle. Now I need to pass a HDC from one process to the other. Is…
Heinrich Ulbricht
  • 10,064
  • 4
  • 54
  • 85
8
votes
1 answer

What does the '@' mean when prefixed to Windows font face name?

With EnumFontFamiliesEx, I get two instances of some fonts, the second of which has '@' prefixed to the face name in the LOGFONT. For example, I get "MS PMincho" and "@MS PMincho". Yet for other fonts, I just get a single instance, like "Arial". …
Adrian McCarthy
  • 45,555
  • 16
  • 123
  • 175
8
votes
1 answer

C# Image Resizing - Losing EXIF

Yes yes... I've seen other posts related to this issue, and yes... I've googled about it. But so far, I was not able to get to the result I need. I'm loading a large image taken in 300 dpi, and I need to resize it. I know... I know... dpi is…
Naner
  • 1,292
  • 6
  • 25
  • 43
8
votes
2 answers

Using FillRect() in C++

I am new to using Graphics in Visual C++. I am just trying to make a rectangle filled with a color. Need help to correct this... RECT rect; HDC…
8
votes
2 answers

How to "Clear" a WinAPI Transparent Window

I have created a Transparent Checkbox in Win32 C++. I have made it because as far as I know you cant have a transparent checkbox in native win32 and I need to use this checkbox in a NSIS installer. My Problem: When repainting, I don't know how to…
sazr
  • 24,984
  • 66
  • 194
  • 362
7
votes
1 answer

Can I get HDC from WPF window so that I can draw to it with Gdi+ API?

I have a library that draw on to given HDC using GDI+ apis. I want to use that in a WPF application. I did try getting the handle from WindowInteropHelper class and passing it to the library method which does the drawing. However it fails simply…
Nitesh
  • 2,681
  • 4
  • 27
  • 45
7
votes
2 answers

How to convert bitmap to grayscale by pixel intensity using GDI?

I'm looking for the simple solution of how to convert the 32-bit bitmap to grayscale using GDI (not GDI+). Is there a possibility e.g. by changing the bitmap's pallete or something ? Of course there is plenty of examples in Delphi like this one, but…
Martin Reiner
  • 2,167
  • 2
  • 20
  • 34
7
votes
1 answer

draw on desktop using visual c++

I am writing an opencv application to draw using laser beam using visual studio VC++ console application. I want to draw lines on desktop. I know that the drawing functions are available in GDI32.dll , but confused on how to integrate GDI32.dll…
Rajesh Agrawal
  • 484
  • 2
  • 5
  • 18
7
votes
2 answers

In which situations is it a good idea to prefer GDI over DirectX/OpenGL

I'm new to graphics programming and I'm wondering why I would ever prefer GDI over the hardware accelerated graphics of DirectX/OpenGL? Are there still good reasons to use GDI?
xcrypt
  • 3,276
  • 5
  • 39
  • 63
7
votes
2 answers

Direct2D interface and blurry text issue

My new application will feature a rich interface which should be resizable on-the-fly uses transparent icons/images etc. For this application I'm trying to decide on using the new Direct2D API against the good old GDI. One of the downsides is of…
demorge
  • 1,097
  • 1
  • 7
  • 17