I have one window that is drawn to by various objects to create a layered effect (think of a heads up display where one object draws a compass, the other draws the grid lines, another the altimeter reading etc). So, each object has a black memory bitmap that it draws to. When I call that objects Draw function, the memory bitmap is blitte...
Supposing I was developing a fairly graphically intensive application (C++ or C#, graphics API undecided) for which most of the usage will be by remote users over RDP (either terminal server sessions or remote access to a single-user machine). It's obvious that non-essential "eye-candy" effects and animations should be avoided. My ques...
Hi,
I can't draw a pattern with a transparent background. This is my snippet :
bitmap.CreateBitmap(8, 8, 1, 1, &bits)
brush.CreatePatternBrush(&bitmap)
hbrush = pCgrCurrentDC->SelectObject(&brush);
// set text color
TextCol = pCgrCurrentDC->SetTextColor(CgrColourPalRGB);
int oldBkgrdMode = pCgrCurrentDC->SetBkMode(TRANSPARENT);
//dr...
[ExternalException (0x80004005): A generic error occurred in GDI+.]
IpitchitImageHandler.Data.ImageRepository.AddNewTempImage(Stream image, String extension, Guid PageId, Guid ImageId, ImageTransformCollection toDoTransforms) +1967
IpitchitImageHandler.Data.ImageRepository.AddNewTempImage(Stream image, String extension, Guid PageId...
We're maintaining an old video game that uses a full-screen 256-color graphics mode with DirectDraw. The problem is, some applications running in the background sometimes try to change the system palette while the game is running, which results in corrupted graphics.
We can (sometimes) detect when this happens by processing the WM_PALE...
I need to draw text onto a window HDC along a circular path using C/C++, and I'm getting google-eyed from searching for several hours. Can someone point me to a good reference?
...
My scenario:
I have one color background image JPG.
I have one black text on white background JPG.
Both images are the same size (height and width)
I want to overlay the image with black text and white background over the color background image, i.e. the white background becomes transparent to see the color background beneath it.
Ho...
When GDI+ came out, I remember all the brouhaha about how it was the "new, faster, better" way to display stuff in Windows. But everytime I looked at it, it seemed to me that it was really just a COM wrapper around GDI.
Is that true? Or is GDI+ really an independent graphical library that simply shares some paradigms with GDI?
Personal...
I'm looking for a way to generate PDF files using the standard PrintDocument and Graphics (GDI) classes in .NET. As far as I know, the only way to do that is by printing to a PDF printer.
The problem is that a PDF printer driver always asks for a filename, but I need to control the filename from my code. Using a PDF library like PDFShar...
I'm attempting to draw an image using StretchDIBits with an Enhanced Meta
File handle as the HDC to my OnDraw function using C++ and Visual Studio
2008. I load the .bmp source file using GDIplus and using GetHBITMAP.
If I use the HDC returned by BeginPaint there are no problems.
If I draw the bitmap upright, flipped horizontally, or fli...
I am coding in c++, gdi
I use stretchDIBits to draw Images to dc.
::SetStretchBltMode(hDC, HALFTONE);
::StretchDIBits(
hDC,
des.left,des.top,des.right - des.left,des.bottom - des.top,
0, 0,
img.getWidth(),
img.getHeight(),
(img.accessPixels()),
(img.getInfo()),
DIB_RGB_COLORS...
We have a requirement where our application needs to support high resolution monitors. Currently, when the application comes up in High res monitor, the text that it displays is too small. We use Arial 12 point font by default.
Now to make the text visible, I need to change the font size proportionally. I am finding it tough to come up...
I've been playing a big with the DC obtained with CreateDC(L"DISPLAY",NULL,NULL,NULL) and I've been wondering why does windows let you draw on the whole screen that easily, cause I think you could do some pretty evil stuff with that like putting a TIMER at 1ms and drawing a black rectangle on the whole screen every time the timer ticks.
...
I will soon be working on 'Print' and 'Print Preview' features of a product I am working on. I do not own a printer nor do I have any intention of buying one. I am looking for any free software which I can use to test my printing code.
What are the best free options I can use to emulate a printer? I am using GDI+ on Windows but platfor...
Hi,
I have written a simple PhotoEditor helper class to downscale and crop images uploaded to my website. Everything is working but I am seeing unsatisfactory quality when the image is saved to file. I have read up on the different settings you can tweak below is my setup for resizing, cropping is identical.
public Image ResizeImag...
How to Convert a Bitmap-like struct into an HDC?
I am now writting image processing program in c++, gdi.
If I got a HDC.
I can draw whatever I like on the HDC in gdi by the following code.
// HDC is handy.
HDC dc;
dc.DrawXXX // I can draw using gdi method.
Graphics gr(dc); // now I can also draw on the dc using gdi+ method.
My...
I need to be able to validate if a JPEG image is valid and not corrupted. This is not the same as question 210650 which just asks wants to validate that it is, in fact, a JPEG image. Loading from Image with validation eg:
var testJpg =
Bitmap.FromStream(filename, useEmbeddedColorManagement, validateData);
will not throw an except...
I am using layered windows and drawing a rounded rectangle on the screen. However, I'd like to smooth out the jagged edges. I think that I'll need alpha blending for this. Is there a way I can do this with GDI?
...
Hi,
I am trying to generate a PDF using XSL(XML-FO) to transform a generated XML from a database.
Because of complex rules in terms of paging for this document, calculations are done in determining the page breaks when I generate the XML that will be consumed by the XSL. I have noticed that I've been getting inconsistent results with ...
I need to be able to draw a bitmap that is at a specific resolution (~40 DPI), on screen using GDI, and also be able to replicate spacing between each pixel. The space is a fraction of the pixel size, but it is noticeable to the eye.
Is there anyway to setup the Graphics class or a Bitmap to have it insert "white space" between drawn p...