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
0
votes
0 answers

DC.DrawText with different font properties but same font

I would like to draw text into a GDI device context DC using the same font but with different styles. I create a CFont object, select that font object into the DC and then I use DC.DrawText to draw text into that DC using that font. The context is…
0
votes
1 answer

How to improve the drawing efficiency of big number of objects with GDI or Qt

I have made a software similar to AutoCAD, which can read and show dwg files and draw lines or curves on top of the dwg background. And I can use mouse wheel to zoom in or zoom out the drawing. Now I encounter a drawing effiency problem and I can't…
Phymin
  • 123
  • 8
0
votes
1 answer

Drawing Overlays with gdiplus

Right now I am attempting to draw overlays in gdiplus, however when I start my program it is able to locate our window but it wont draw my overlay line. Am I missing something? The documentation suggests that I should be able to do this. #include…
brainlet
  • 41
  • 6
0
votes
1 answer

Fix Graphics draw area size

I'm just starting to learn the GDI+ system for drawing lines, circles etc. I've created a component (scanner) that inherits a Panel to draw on (not sure if panel or picture box is best). On the "Scanner" Im currently drawing a circle on it. the…
Harag
  • 1,532
  • 4
  • 19
  • 31
0
votes
0 answers

CMFCPropertyGridProperty and Threads

During update a value in a CMFCPropertyGridProperty from another thread, my application crashes. I assume it's a timing issue because setting the value in same thread via another function works. The question is how to solve this? My first idea was…
boiler
  • 140
  • 10
0
votes
2 answers

Resizing Ellipse

I dont understand why this doesn't work. On message WM_LBUTTONDOWN, the coordinates of the pointer are stored. then on WM_MOUSEMOVE, if the left button is down, i want it to draw an ellipse with the original points and the new points that are where…
Geore Shg
  • 1,299
  • 5
  • 23
  • 38
0
votes
0 answers

WinAPI non-compromising borderless window with shadow underneath

What do I want to achive: I want to create a window that behaves like a WS_OVERLAPPEDWINDOW | WS_SIZEBOX(can be minimized, maximized, closed from system context menu on Alt+Space, supports Window Snapping, has shadow if it is enabled in system…
maxnevans
  • 1
  • 3
0
votes
1 answer

Do you really need to put back the original device context bitmap or is it okay to simply switch it out and delete the original?

If I create a memory device context CreateCompatibleDC() and then SelectObject() a bitmap I created to it. Can I just DeleteObject() the old bitmap returned by SelectObject() and let the device context delete the bitmap I created? Or do I have to…
df234987
  • 513
  • 2
  • 13
0
votes
1 answer

MFC/GDI CRgn CreateEllipticRgn is two pixels short?

If I do CRgn::CreateEllipticRgn(0, 0, 120, 120); the result ends up with two pixels short at the right and bottom. Why is that? I thought maybe because a Region is within the outline rather than on the outline but in that case it should have been…
df234987
  • 513
  • 2
  • 13
0
votes
1 answer

How to gracefully close this simple Windows GUI program? Because it doesn't (sometimes)

I'm having an issue with my Windows application where upon closing it from the taskbar or via hotkey it will occasionally hang. I'm wondering how to gracefully exit the following program: LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM…
Nux
  • 31
  • 1
  • 5
0
votes
2 answers

Control to draw in a window gdi

I have used Visual Basic 6 in the past (LOONG ago), and it had a control called PictureBox where you could just draw stuff to, get a device context if you wanted, etc. I'm now trying to find out how to have a similar "control" in pure GDI/WinApi (no…
stelonix
  • 716
  • 1
  • 5
  • 24
0
votes
1 answer

Opening Several Websites and screenshotting | GDI Error

I've created a PowerShell script that opens several websites located in an Excel Spreadsheet and takes screenshots of each one. Here is the Code: [Reflection.Assembly]::LoadWithPartialName("System.Drawing") function…
JSP83
  • 1
0
votes
2 answers

Crop an HBITMAP with C++ on Windows

I have an HBITMAP holding the screenshot of a window. Now I want to crop a certain region/rectangle out of it and return it as a new HBITMAP. The following code however only squeezes the image into the correct new rectangle size but does not crop…
BullyWiiPlaza
  • 17,329
  • 10
  • 113
  • 185
0
votes
1 answer

Device context size is getting reduced during drawing sometimes

We have an application in MFC. We have come across an issue with device context. The situation is like - we have an info display window, which is variable in size and posiion. During some size and position changing scenarios, only part of the…
Dinu
  • 11
  • 2
0
votes
0 answers

C# WinForms UserControls and labels blurry while using GDI Scaling

I have tried nearly all approaches that should allow reasonable scaling on for example 4K monitors. None works for me perfectly, sometimes there are problems with single controls (MenuStrip for example), sometimes there are problems with moving to…
0x802a
  • 1
1 2 3
99
100