gdi+ Questions
7
Exception:
A generic error occurred in GDI+.
at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
at System.Drawing.Image.Save(String filename...
4
So, after discovering that the Bitmap class expects the original stream to stay open for the life of the image or bitmap, I decided to find out if the Bitmap class actually closes the stream when i...
Donnell asked 25/5, 2011 at 10:53
3
I am working in a spinner control. I want the control to support transparent backcolor. When the arc is drawn, there is a blank space in the middle, I want that space to be truly transparent, so th...
Crazed asked 13/5, 2016 at 22:38
4
I'm trying to include the following definitions for GDI+ into my Win32 C++ project that is compiled under Visual Studio 2017:
#include <objidl.h>
#include <gdiplus.h>
#pragma comment (...
Gawain asked 12/7, 2019 at 22:41
4
Solved
I've been looking for an optimized (i.e., quick) algorithm that converts a 24-bit RGB bitmap to a 16-bit (RGB565) bitmap using dithering. I'm looking for something in C/C++ where I can actually con...
18
Solved
I am working on to upload and save a thumbnail copy of that image in a thumbnail folder.
I am using following link:
http://weblogs.asp.net/markmcdonnell/archive/2008/03/09/resize-image-before-upl...
Maiduguri asked 7/4, 2013 at 13:18
1
I'm trying to get the size of the text string using GetTextExtentPoint32. I read the documentation many times and do some research and as far as I know, the below code should give me the corr...
Larine asked 25/3, 2021 at 8:50
17
Solved
i've got some binary data which i want to save as an image. When i try to save the image, it throws an exception if the memory stream used to create the image, was closed before the save. The reaso...
1
I'm trying to create a Label class where I can just reuse it later. What I've done is create a static control, then use the GDI+ library to DrawString on it.
It's almost done, I only have one issue...
Atavism asked 16/3, 2021 at 9:4
6
Okay, I am looking for a function or something that will read the color of a certain pixel on my monitor, and when that color is detected, another function will be enabled. I figure using RGB. All ...
3
4
I am currently dynamically creating a bitmap and using the graphics object from the bitmap to draw a string on it like so:
System.Drawing.Graphics graph = System.Drawing.Graphics.FromImage(bmp);
g...
Brierroot asked 10/5, 2010 at 15:22
2
Solved
I had assumed that Gdiplus::Bitmap::FromFile returns NULL if the file is not a valid image, but it returns a non-NULL even if I pass it a doc file, for example. There doesn't seem to be an IsValid ...
8
Solved
After several days of tracking down bizarre GDI+ errors, I've stumbled across this little gem on MSDN:
Classes within the System.Drawing namespace are not supported for use within a Windows or A...
Reine asked 6/10, 2009 at 22:56
3
Solved
I want to reduce the number of unique colors of a bitmap in c#.
The reason I want to do this is that an image which is initially created with three color but due to many factors (including compres...
Lukasz asked 8/7, 2011 at 10:18
4
Solved
I haven't written anything with GDI for a while now (and never with GDI+), and I'm just working on a fun project, but for the life of me, I can't figure out how to double buffer GDI+
void DrawStuf...
7
Solved
As I'm bringing in images into my program, I want to determine if:
they have an alpha-channel
if that alpha-channel is used
#1 is simple enough with using Image.IsAlphaPixelFormat. For #2 thoug...
Carmelocarmen asked 17/6, 2010 at 19:16
0
I run this code:
graphics.DrawString("( پنج)", new Font(IranNastaliq, 77), ...);
which results in:
As you can see, circled parts are overlaid and turned transparent. Why those parts get...
Persse asked 9/9, 2020 at 17:33
0
I'm using this method to generate bitmaps from strings:
private Bitmap ConvertTextToImage(string text, FontFamily fontFamily, float fontSize,
FontStyle fontStyle = FontStyle.Regular, StringFormat ...
Saffren asked 3/9, 2020 at 9:5
1
I'm currently working on creating an Ambilight for my computer monitor with C#, an arduino, and an Ikea Dioder. Currently the hardware portion runs flawlessly; however, I'm having a problem with de...
Fascista asked 23/10, 2013 at 18:57
2
I have a changing sized image, and I would like to know which font size I should use to fit that dynamically changing size.
As you know, there is a Graphics.MeasureString method, which calculates t...
1
I made a Custom Control with the functions of a Button.
The problem with this controls is that when you hover over it, the color of the button changes: when this action is repeated quickly, it glit...
2
Solved
The GDI+ generic error when saving a bitmap is obviously a common problem according to my research here on SO and the web. Given following simplified snippet:
byte[] bytes = new byte[2048 * 2048 *...
Rotenone asked 31/10, 2013 at 10:29
3
Solved
I am making a median filter, the problem is manipulating pixes are only possible in Bitmap. Later I want to show the result in a PictureBox which uses Image. I can't figure out a way to to solve th...
2
Solved
Issue: Attempting to zoom (scale) an Image from (or at the) mouse location using transforms in the Paint event to translate bitmap origin to mouse location, then scale the Image and translate its o...
© 2022 - 2025 — McMap. All rights reserved.