2,192 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
1
answer
149
views
How to draw image to GDI properly?
I'm trying to use GDI to draw RGB images on Win32 window.
To draw, I first write colors to buffer in WM_CREATE and then draw it in WM_PAINT using StretchDIBits:
unsigned char imageData[46 * 32 * 3];
...
0
votes
0
answers
78
views
wxWindow can't have transparent background and replacement for it
I created this C++ class for my wxWidgets app. The bitmap and image are both transparent.
#include <wx/wx.h>
#include <wx/image.h>
class PouCharacter : public wxWindow
{
public:
...
0
votes
1
answer
35
views
Right aligned italic text drawn by DrawTextW is clipped on the right side
This code
procedure TForm1.Paint;
var
r: TRect;
txt: WideString;
begin
inherited;
r := Rect(0, 0, 200, 100);
txt := 'Lorem ipsum dolor sit amet, consectetur ' +
'adipiscing elit, sed do ...
0
votes
0
answers
26
views
Should / can StretchBlt do interpolation when enlarging?
I have input images variously sized from about 400x800 to 1200x2400 px (not always 2:1 aspect). These are each a single continuous line of black pixels on a white BG -- a graph line of sorts. I ...
0
votes
1
answer
134
views
HDC draw all screen
I use an HDC for drawing on screen:
void drawScreen() {
hDC = GetDC(GetConsoleWindow());
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 20; j++) {
if (gameMap[i][...
1
vote
0
answers
91
views
System Windows Form Method 'ControlPaint.DrawReversibleFrame' seems to have a bug after latest 2024H2 update on multi-monitor setup
In a charting software I have been using for 10+ years without change, after recent windows 11 update (2024H2 cumulative update from April 2025), I noticed that chart zoom selections on the bottom ...
0
votes
0
answers
73
views
How to make MSAGL subgraphs render okay with WPF viewer vs GDI viewer
A piece of code using MSAGL with the GDI viewer is able to make an acceptable rendition of a graph with subgraphs, e.g.:
open System.Windows.Controls
open System.Windows.Media
open Microsoft.Msagl....
0
votes
0
answers
93
views
IShellItemImageFactory::GetImage returns upside down HBITMAP without negative height
So I got the shell enumeration working correctly, I get all the names of the items and their associated images, including both thumbnails and image icons as necessary, and it matches what I see in ...
Blindy's user avatar
- 67.9k
0
votes
0
answers
68
views
Painting outside invalidated region from within WM_PAINT
My custom Win32 control invalidates (using InvalidateRect()) precisely the regions for which it knows they require repainting.
The control also allows users to hook an overlay event, allowing them to ...
5
votes
0
answers
284
views
What is "display file" in Windows and how it differs from metafile?
Windows has long supported metafiles, a special graphics format for storing drawing commands. I won't go into this topic further; if you are interested - please refer to the Wikipedia article linked.
...
1
vote
0
answers
68
views
GDI+ DrawLines bug when used with Pen size more than 1
The following code:
Graphics g(hdc);
Pen pen1(Color(0, 0, 0), 1.0f);
pen1.SetAlignment(PenAlignmentCenter);
Pen pen10(Color(0, 0, 0), 10.0f);
pen10.SetAlignment(...
0
votes
0
answers
36
views
Wrong behaviour of GDI+ DrawLines with PointF
The following code:
Graphics g(hdc);
Pen pen(Color(0, 0, 0), 10.0f);
std::vector<Point> line1;
line1.push_back({ 100, 100 });
line1....
0
votes
0
answers
89
views
Issue trying to use GetDIBits to capture a portion of the screen/window
Context:
I'm trying to make a bit of code that can essensially detect the framerate of a target window. My current goal is to use a checksum to check if the window has changed. The specific situtation ...
2
votes
0
answers
128
views
How to Access and Reconstruct HBITMAP Data from a Debugged Process
I am developing a Visual Studio 2022 extension to extract HBITMAP objects from the memory of a debugged process for analysis.
Ideally, I want to access and reconstruct the raw bitmap data directly, ...
4
votes
0
answers
186
views
Is this an error in the documentation of TransparentBlt()?
Microsoft's documentation of the GDI function TransparentBlt() states:
The TransparentBlt function supports all formats of source bitmaps. However, for 32 bpp bitmaps, it just copies the alpha value ...