Jump to content
Software FX Community

Guest Colin
 Share

Recommended Posts

Guest Colin

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

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...