Questions tagged [gdi+]

The Graphics Device Interface (GDI) is a Microsoft Windows application programming interface and core operating system component responsible for representing graphical objects and transmitting them to output devices such as monitors and printers. -Wikipedia

Filter by
Sorted by
Tagged with
0 votes
0 answers
58 views

What is the easiest way to replace GDI+ Bitmaps/Images in an application

I am working on an old 32bit VB.Net WinForms application that loads a batch of images from a scanner (using an Atalasoft TWAIN library) and uploads them to a network location. In order to speed up the ...
Shadow's user avatar
  • 3,956
1 vote
0 answers
50 views

The issue of incorrect positioning of text coordinates from SVG in C++ using the GDI+ library

Lately i have been working on a small project that reads information from SVG file and then using GDI+ to draw, but im having trouble with text drawing position, because what i draw is not the same as ...
Tran_Duc_Tung_HCMUS 's user avatar
0 votes
0 answers
86 views

Win32 - Drawing a native window with a specific style

Does the Win32 API expose any of the facilities that are used by Windows to draw the native controls as they appear by default? Say my application wants to display a non-interactive preview/mockup of ...
user2593449's user avatar
-1 votes
0 answers
54 views

How to send gdi plus data through socket?

I'm building a remote help software like team viewer, where I need to receive the client's screen at my server. I'm using gdi plus to get the screen print and save it to a jpeg: int ...
kuybt6's user avatar
  • 31
0 votes
0 answers
47 views

How to load an image byte array into QGraphicsView?

I'm building a module for an application and, this module should take a print from the screen and show it into a QGraphicsView. This is my Print Screen code that saves the taken photo into a jpg file: ...
kuybt6's user avatar
  • 31
1 vote
0 answers
74 views

Why does Gdiplus::Region::IsEmpty() require a Graphics object as an argument?

I wrote this function to determine whether a Gdiplus::GraphicsPath intersects a Gdiplus::RectF. It works as expected, but I don't understand why I need to pass a Graphics object to the IsEmpty() ...
Liam Bohl's user avatar
  • 386
0 votes
0 answers
34 views

how to create dynamically Point point[] to use in (place the x, y values from computation within a for loop)

how to create dynamically Point point[] (place the x, y values from computation within a for loop) then use in LineTo GDI+ within for loop with a point array? LineTo(hdc, point1, point2); want ...
elwolv's user avatar
  • 9
2 votes
1 answer
90 views

Creating a floating anti-aliased text window in Delphi

I want to create a floating (top level) window that shows only Anti-Aliased text (no other window elements). I am trying to draw the text using GDI+ to maintain the alpha channel on the text rendering ...
bLight's user avatar
  • 835
0 votes
0 answers
30 views

winapi how to upload an image with an alpha channel? [duplicate]

I need to upload a PNG image. In the old project, I did this using drectx CreateDecoderFromFilename, but the code turned out to be too voluminous, I don’t want to bloat the project too much just to ...
I101I's user avatar
  • 65
0 votes
0 answers
46 views

Artifacts after corner rounding, pywin32

I have minimal code in python kivy + pywin32. I use the CreateRoundRectRgn function to create a region with rounded corners, and then assign this region to my window via SetWindowRgn. How to remove ...
xx1mde's user avatar
  • 1
0 votes
2 answers
63 views

how to draw multiple draggable and selectable circle?

i wrote somecode to draw circles on a panel by mouse click, i need to add some feature like selecting and dragging this circles , help me to complete my code please, thanks Screenshot of running code ...
Mehdi's user avatar
  • 41
1 vote
1 answer
69 views

How to detach HBITMAP from GDI+ Bitmap?

I'm trying to create an HBITMAP from a GDI+ Bitmap, and whilst this works, as soon as the Bitmap goes out of scope the HBITMAP become invalid, too. How can I detach the HBITMAP from the original GDI+ ...
user20716902's user avatar
0 votes
0 answers
22 views

QR code on my report is sometimes showing as error

I am generating a report, the report contains all the data fetched from the DB and a QR code should be shown at the bottom of the page. But sometimes the QR code is not showing, and an image with X is ...
bharath p's user avatar
0 votes
2 answers
42 views

Draw a rotated and scaled rectangle centered at a certain point

I'm developing a drawing program, and using GDI+ with this transform (pseudocode): TGPGraphics.TranslateTransform(100,100); TGPGraphics.ScaleTransform(2.2,2.2); TGPGraphics.RotateTransform(27); ...
A. Fornés's user avatar
4 votes
1 answer
114 views

Troubleshooting Windows Preview Handler Issues: GDI+ and Direct2D Integration

I'm trying to create a Windows preview handler for a file type (.abcd in the following) that draws in the preview window using GDI+ and Direct2D based on the contents of the selected file. I used the ...
Haksoby's user avatar
  • 43
0 votes
0 answers
48 views

Change GDIProcessHandleQuota value using c#

I have tried to get the registry value using c#. I change the value but it doesn't change the actual value of my machine. When I checked my reg editor the value was still the same but when I checked ...
itsOrionZ's user avatar
1 vote
0 answers
38 views

GDI+ DrawImage has different output results when using a printer to print images on a low DPI system and a high DPI system

when I print an image using GDI+ DrawImage method on a high DPI system, the result differs from what printer is used. Next is my test code: using namespace Gdiplus; void printImage(std::wstring ...
douxiaobao's user avatar
0 votes
0 answers
45 views

Graphics.MeasureCharacterRanges does not give useful information for piecewise printing of text

GDI+ in C# is fun! While on the topic of doing some printing I ran into the following situation: Graphics.DrawString allows us to render a complete paragraph inside of an arbitrarily defined bounding ...
lhiapgpeonk's user avatar
-1 votes
1 answer
89 views

Black screen when im trying to make double buffered GDI overlay

Im trying to create double buffered gdi overlay over desktop but all what i get is black screen with red line HDC hdc = GetDC(0); HDC mem_handle = CreateCompatibleDC(hdc); HBITMAP ...
kiiiiiiiiiiiiiiiiiiiilmepls's user avatar
0 votes
0 answers
53 views

Gdiplus compile time errors in my cpp library

I'm trying to use Gdiplus library in my C++ library in visual studio 2022. Before compiling I tested my codes in a c++ code with main function and it works. the code is here: #include <opencv2/...
Babak.Abad's user avatar
  • 2,885
0 votes
1 answer
114 views

Maximum Size of a GDI Image? [duplicate]

I'm trying to create a very big image from pixel data, using GDI+. The code looks something like this: Gdiplus::Status CreatePNG(int tileSize, int height = 16 * 1024) { Gdiplus::Status status = ...
Enno's user avatar
  • 1,766
0 votes
0 answers
58 views

Draw line with DashPattern resutls a solid line in C#

I draw a line with [2/3f, 1/3f] dash pattern, but results a solid line. I also tried other dash patterns, here is the results: [2/3f, 1/3f]: a solid line [0.5f, 0.25f]: a good dash line [0.6f, 0.3f]: ...
Dallon Xu's user avatar
-1 votes
1 answer
82 views

c++ curl download image and save in gdi+ Image object

I have a code that downloads an image and saves it in file: void saveImage(string url) { CURL* curl = curl_easy_init(); FILE* file = fopen("img.png", "wb"); ...
Ogurchik's user avatar
0 votes
1 answer
46 views

windows.h gdi+ draw in WM_COMMAND

I'm trying to draw a line with gdi+ by clicking button using WM_COMMAND, but the line doesn't show up when I click the button. It works when I use WM_PAINT though but I need it to show up when ...
Ogurchik's user avatar
1 vote
0 answers
60 views

Behaviour of Graphics.AddRectangle() / Graphics.DrawPath()

I attempt to draw lines on specific coordinates using a Graphics.AddRectangle() and Graphics.DrawPath(). The parameters of my Rectangle: Dim objPath As New GraphicsPath objPath.AddRectangle(New ...
Bender110001's user avatar
0 votes
1 answer
142 views

How to combine two bitmaps vertically (using LockBits, and BitmapData)

I need a function in C# that returns merged bitmaps vertically. I want the resulting image to contain two bitmaps set one above the other. I don't have much experience with processing images in unsafe ...
pl.lepko's user avatar
1 vote
0 answers
51 views

C# StretchBlt to copy between two Bitmaps draws nothing

tl;dr; I'm trying to use the following code to copy and stretch part of my srcBmp bitmap into my destBmp using StretchBlt - it's returning 1 indicating success, but there's nothing drawn on the ...
mclayton's user avatar
  • 8,432
0 votes
0 answers
101 views

WinForm How to use dirty rectangles to improve 2D drawing efficiency

I need to draw a lot of 2D graphics in the window. If I keep refreshing, it will lead to slow efficiency. I have learned about the drawing method with dirty rectangles. When using dirty rectangles for ...
gzhhhhh's user avatar
-1 votes
1 answer
64 views

win32/gdi drawing lines or make a pixel move

this is my code: #include <Windows.h> #include <iostream> #include <string> #include <sstream> LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { ...
Matteo Rocco Micò's user avatar
0 votes
1 answer
35 views

Method that turns image to BW does not work

public float ToBlackAndWhite(BlackWhiteMode mode) { var data = _bmp.LockBits(new Rectangle(0, 0, Width, Height), ImageLockMode.ReadWrite, _bmp.PixelFormat); var IsWhite = mode ...
Simon's user avatar
  • 3
0 votes
0 answers
120 views

Problems with the use of GDI+

I'm implementing a thumbnail extension on Windows. I'm trying to convert a picture to a bitmap using GDI+. There is a problem with the use of GDI+ that has bothered me for a long time. Consider the ...
feiniks's user avatar
  • 28
0 votes
1 answer
32 views

Picturebox throws "Argument is not valid" when assigning a MetaFile to an image

.Net 4.7.2. Winforms. Rendering a complex page full of text and graphics. I used a Bitmap. I then show it in a preview window by sizing a PictureBox and placing the picturebox into a panel that ...
John Tamburo's user avatar
5 votes
0 answers
56 views

C# - Unexpected pixel values from Graphics.DrawImage() result when dealing with alpha

I need to perform a Graphics.DrawImage from a source to a target image, ideally from a smaller tile to a larger poster, but it doesn't matter in the specific scenario. I write into an empty target ...
Fux's user avatar
  • 111
0 votes
0 answers
107 views

Where is the byte Array?

I have C++ code that uses GDI to take a screenshot of the environment, and GDI+ to compress it into a JPG. I want to send the image over TCP, and for that I need to know where the byte array that ...
kuybt6's user avatar
  • 31
0 votes
0 answers
78 views

Size of GraphicsPath drawing?

I'm working on a program that allows using a bitmap (in a PictureBox) as a text object. I have things mostly working, even word-wrap, all except for outlined text. private void DrawOutlineString(...
woodmage's user avatar
0 votes
0 answers
25 views

Building Collision Detection for Integer Arrays and Rectangles

Collision Detection Between Integer Array and Rectangle C# I am programming a remake of the old arcade game snake within a Windows Forms Application (.NET Framework) , I am currently using a GDI ...
Alexia Balim's user avatar
0 votes
0 answers
109 views

Dashed line is painted incorrectly on a meta file canvas

I had a code which draws the diagrams on a canvas using GDI+ on a bitmap canvas. The bitmap was converted to PNG and exported to an external service/user. But there is obviously scaling problem with ...
Z.B.'s user avatar
  • 1,195
0 votes
0 answers
134 views

Why am I getting a `generic error in gdi+` exception using `Image.SelectActiveFrame`?

I'm developing a C# (WinForms) program using .NET Framework 4.7.2, where I input a TIF/TIFF file, which can have multiple pages (or frames if that's the correct term), then load each image (frame) to ...
IOviSpot's user avatar
  • 358
0 votes
1 answer
63 views

C Make own window (GUI) scroll viewer using ScrollWindowEx() wrong content

I'm trying to create a window and create own scroll viewer (v-scroll) using ScrollWindowEx() in handling the WM_MOUSEWHEEL window message and it worked but shows me wrong and invalid contents. My ...
HelloGUI's user avatar
  • 161
0 votes
3 answers
110 views

C++ GDI+ Image class: how to acess private member declared in class 'Gdipus::Image' C2248

I tried to read my PNG image file to create a sprite from it. I used this code for reading and drawing images: wchar_t filename = L'bunny.png'; wchar_t* path2 = &filename; Image image = Image(...
Timofey Kalakutsky's user avatar
0 votes
0 answers
49 views

C# Scale with the pixel of the mouse position, but there will be an offset between the two

Zoom in on a certain pixel of the image, and there is an offset between the pixel position and the mouse after zooming. But I am zooming at the position of the mouse. At this time, the mouse is on ...
jzian's user avatar
  • 23
-1 votes
1 answer
189 views

Clear drawn gdiplus rectangle

I'm drawing a semi-transparent rectangle with gdiplus over all windows in a loop, for each cycle the rectangle loses its transparency. How do I clear the previously drawn rectangle or keep it with the ...
Sinusoidal Depleneration's user avatar
0 votes
0 answers
57 views

Drawing to a GDI+ metafile that is based on a memory stream - can the stream be disposed afterwards?

I am using a MemoryStream to write my GDI+ drawing commands to a Metafile, and display the Metafile later in order to accelerate such trivial tasks as panning and zooming. That works fine. When I ...
oliver's user avatar
  • 2,791
0 votes
1 answer
118 views

GDI+ image doesn't update on drawing

I'm looking into GDI+ in Delphi, and found the demo below. (Can't remember where.) It's quite straightforward, and works fine on the first click: a series of circles is drawn side by side on a ...
stevenvh's user avatar
  • 2,971
2 votes
0 answers
106 views

why SetWorldTransform fails when drawrectangle with graphics first and drawtext with cdc second

I draw a rectangle and text with Graphics and CDC respectively. CDC dcMem; dcMem.SetWorldTransform(&xform); //magnify by x2.0 Graphics myg(dcMem); myg.DrawRectangle(&mypen, 10, 10, 100, 100); ...
mathddsccc's user avatar
0 votes
0 answers
61 views

Undefined Reference to gdiplus Error in CMake Project with GCC 12.2.0 Compiler

I tried to convert my C++ project on visual studio into a cmake project using cmake-converter and use gcc 12.2.0 from msys. However, after converting it I get a lot of error complaining. Below is the ...
Ron's user avatar
  • 1
1 vote
0 answers
73 views

C++ Windows window with opacity background nothing shows

I tried to create a window with a background with true opacity (only background opacity, not anything inside it). This is what I expecting it to be: But, in my project, when I start the program, ...
HelloGUI's user avatar
  • 161
0 votes
0 answers
72 views

How to draw a circle that is on top of all windows opened in Win10

I’m trying to use gdi+ to draw a circle on screen in Win10 with AHK, now I can manage to draw a circle anywhere I want, but the problem is I can’t make it on top of all windows, it could be covered by ...
Chen Jon's user avatar
0 votes
0 answers
10 views

GDI+ ISteam is not able to crate Image and Thumbnails?

I am trying to read a file and create a stream object. From this stream object I am creating a GDI image. I noticed that its not working, particularly the line if (image && (Ok == ...
hardik05's user avatar
0 votes
1 answer
183 views

Stretching TSpeedButton by GDI+ for HDPI

Unfortunately Delphi does not scale TSpeedButton.Glyph. The button surface scaled, but the size of the glyph stay the original. I use the naive approach to scale the bitmap by TCanvas.StretchDraw but ...
SOLID Developper's user avatar

1
2 3 4 5
59