gdi

Is it possible to use AnimateWindow with AW_BLEND when using a layered window?

I am displaying a window using UpdateLayeredWindow and would like to add transition animations. AnimateWindow works if I use the slide or roll effects (though there is some flickering). However, when I try to use AW_BLEND to produce a fade effect, I not only lose any translucency after the animation (per-pixel and on the entire image), b...

Question on Graphics Disposal

Do I need to call Dispose() on a Graphics object obtained through PaintEventArgs in an OnPaint event? ...

DirectDraw - Overlaying

Greetings. I have been trying to create a directdraw overlay for an FPS game so that I could draw certain something over it (windowed mode) (I have been using GDI and it flickers... I know its because of synchronization but I dont want to inject any code into the game) I would appreciate it if you could give me an example usage of dire...

CStatic Custom Control

I am trying to create a custom CStatic control in vc++ and have a few problems. I originally was just using a CStatic control with the SS_BLACKRECT style. This was good for the situation until I needed to display an image over the control on demand. I figured out all the logistics behind actually drawing the image onto the control but I ...

can not draw on GDI+ bitmap object.

I am writing program in c++ gdi gdi+. Drawing large image on gdi+ bitmap is slow is using gdi+ api. So I used the following way to draw: Bitmap img(xxx); Graphics gr(&img); HDC dc = gr.GetHDC(); ::StretchDIBits( dc, rec.left, rec.top, (rec.right - rec.left), (rec.bottom - rec.top), m_recRegin.left , m_recRegin.top, ...

How to detect what window/control is at a specific point onscreen?

Is there a Win32 API call to determine what window and/or control is visible at a certain coordinates and/or under the mouse? ...

Given an HDC, how can I determine what the name of the application is?

I have an HDC object and I'd like to use it to get the name of the program that created it (such as Notepad or Firefox). Is there a way to do this? If not, how can I do this? ...

Printing Issues under Terminal Services (Win32)

For our application, we need to be able to print output at a specific location on a page. For example, we need to be able to print some text at exactly (1.00", 1.00") relative to the top left corner of the page. The problem lies in the fact that all coordinates in the various GDI calls are not relative to the upper left corner of the d...

VB.NET WindowForms Question

Hey, I am looking for a specific custom control. I am drawing some rectangles to my picture box, now I would like to display a tooltip when someone moves his mouse to one of the rectangles, so a hover rectangle-hover event. Does this sound doable at all? If yes, is there anyone that has made such a control already? If no, how would I go...

how do I print an itf barcode in c#

I need to print and interleaved 2 of 5 barcode (18 digits no checksum) using GDI+. I have done this for code 128 barcode using some code found on web. The barcode scanner unfortunatley does not read code 128 so I have to resort to ITF barcodes. Thanks, Ken ...

Using CreateCompatibleDC with mapping modes other than MM_TEXT

I have a visual C++ application that uses a CView derived class to render its display, which is primarily 3d vector data and true type text. The mapping mode used is either MM_ANISOTROPIC or MM_LOMETRIC. I can't use MM_TEXT as I use the same code for printing and plotting of the data and also have to overcome non-square screen pixel is...

WM_ERASEBKGND not followed by WM_PAINT

My app is getting a WM_ERASEBKGND message which is not followed by a WM_PAINT message. Naturally enough my application erases the background, and then just sits there with a blank window. I am running under Vista, but it happens under XP as well. I am pretty sure it is my fault, but what could I be doing so that Windows does not behave?...

CreatePatternBrush / Ellipse not working on WinMobile device but on emulator

To draw a circular part of a bitmap on the screen, I use a PatternBrush created from the bitmap to fill an ellipse. I use P/Invoke to the native functions because there seems to be a bug in CF2.0 if you use the managed functions (see here for more details: http://social.msdn.microsoft.com/forums/en-US/netfxcompact/thread/e831ea2f-039a-4b...

Transparent window containing opaque text and buttons

I'm creating a non-intrusive popup window to notify the user when processing a time-consuming operation. At the moment I'm setting its transparency by calling SetLayeredWindowAttributes which gives me a reasonable result: However I'd like the text and close button to appear opaque (it doesn't quite look right with white text) while k...

.NET GDI bug between 32 and 64 bit?

I have a strange problem with a .NET application. I run the application (a Windows Forms app) on a 64 bit Windows 2008 Server. I run it remotely using Remote Desktop. My application does its own drawing ( i.e. g.DrawString("hello world"...) ) on the app. If I build the app with the Platform Target (in the Build tab of the application pr...

How to implement high speed animation?

I'm trying to write an application (winforms) that can demonstrate how two oscillating colors will result in a third color. For this I need to be able to switch between two colors very fast (at >50 fps). I'm really hoping to do this in managed code. Right now I'm drawing two small rectangular bitmaps with solid colors on top of each ot...

Transparency to text in GDI

Hi , i have created a Bitmap using GDI+.I am drawing text on to that bitmap using GDI Drawtext.Using Drawtext i am unable to apply tranparency. Any help or code will be appreciated. ...

StretchDIBits failed, sometimes it draw nothing,...

I am using gdi c++, StretchDIBits function sometimes failed if I draw large Images such as 7000*5000. It draw nothing. GetLastError() says no enough system resource. Can anyone explain why StretchDIBits need resource even The DC is prepared successfully. ...

CreateDIBSection failed

BITMAPINFO bmi; memset(&bmi,0,sizeof(BITMAPINFO)); bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmi.bmiHeader.biWidth =m_pImg->GetWidth(); bmi.bmiHeader.biHeight =m_pImg->GetHeight(); bmi.bmiHeader.biPlanes = 1; //if( m_pImg->GetInfo()->biBitCount!=16) //{ // bmi.bmiHeader.biBitCount = m_pImg->GetInfo()->biBitCount; //} //e...

How do I use (or get Windows to use) iUniq in a SURFOBJ?

The Windows Driver documentation says that a the iUniq field in a SURFOBJ can be used to determine if a surface has not changed and that the driver can used cached information to re-render the surface. I assume that if my driver is called with a SURFOBJ that has the same hsurf and iUniq values, the pixels of the SURFOBJ have not changed...