Guest Colin Posted June 6, 2014 Report Share Posted June 6, 2014 Hi ChartFX community. I'm trying to get the device context handle for a chart and appropriately release it as well. Here is the code I have that isn't working. I feel that I am close and just need a bit of a nudge to fix it. Dim hDeviceC as IntPtr Dim hwnd As IntPtr hwnd = chart1.Handle hDeviceC = Graphics.FromHwnd(hwnd).GetHdc ... ... ... Graphics.FromHwnd(hwnd).ReleaseHdc(hDeviceC) The error appears on the last line. I also tried the following, but couldn't find a way to connect "e" to my chart - as denoted by the "missing line" Dim e As ChartFX.WinForms.CustomPaintEventArgs <MISSING LINE> hDeviceC = e.Graphics.GetHdc ... ... ... e.Graphics.ReleaseHdc(hDeviceC) Which of these approaches is appropriate? And what am I missing in either case? Thanks, and kind regards, -Colin Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.