G
Guest
Hi,
I have create a Graphics object from a HWND
Both the Window and the Graphics object are created by the same thread,
nevertheless when i dispose the object, I get an exception indicating that
the object is in use some where else.
Any comments?
Best regards
Martin
P.S.: Code looks like:
myGraphics=Graphics.FromHwnd(Parent.Parent.Handle);
parentColorValue=GetPixel(myGraphics.GetHdc(),1,Top+(Height/2));
myGraphics.Dispose();
P.P.S: exception in detail:
A first chance exception of type 'System.InvalidOperationException' occurred
in system.drawing.dll
Additional information: The object is currently in use elsewhere.
I have create a Graphics object from a HWND
Both the Window and the Graphics object are created by the same thread,
nevertheless when i dispose the object, I get an exception indicating that
the object is in use some where else.
Any comments?
Best regards
Martin
P.S.: Code looks like:
myGraphics=Graphics.FromHwnd(Parent.Parent.Handle);
parentColorValue=GetPixel(myGraphics.GetHdc(),1,Top+(Height/2));
myGraphics.Dispose();
P.P.S: exception in detail:
A first chance exception of type 'System.InvalidOperationException' occurred
in system.drawing.dll
Additional information: The object is currently in use elsewhere.