Controls and GDI+ surfaces

eisman

New member
Joined
Feb 27, 2003
Messages
1
I am developing some 3rd party software for some MMOs that I play and have been trying to use .NET controls directly Bltd to a Graphics surface. I have access to the primary 3d canvas of the game, and can coerce that into a .NET Graphics object. I can draw text, shapes, and other graphics items on the surface, and I subclass the game window to recieve mouse/keyboard input messages.

I am trying to figure out the best way to be able to use standard .NET controls in the display. I am setting up controls as the windows form designer does, and on EndScene of the games screen render I call the Draw event of the Panel and iterate the control collection. During the iteration I call the InvokePaint and InvokePaintBackground methods of each of the controls.

The result of this code is some half drawn controls. My button controls background is drawn at a different position than its background, and textboxes only shows the white background.

My question is, "Is there a proper way to render controls to a custom graphics surface as opposed to a normal windows form"?

This project happens to be in VB.NET, but I have done similar things with C#. Discussion/Snippets in both languages are welcome.
 
Back
Top