Jump to content
Software FX Community

GetPicture and leak of GDI objects


User (Legacy)
 Share

Recommended Posts

Hello

When I call GetPicture in the ChartFX then I see GDI objects leak. Why?

(if I pass parameter as CHART_BITMAP then 1 GDI object per time if I pass

parameter CHART_METAFILE then 2 GDI object per time )

Can you offer me any work around?

PS I use Chart FX Client Server ActiveX Control (version 5.0.9)

example of my code ;-)

Private Sub Command1_Click()

ChartFX1.GetPicture CHART_BITMAP

End Sub

Thanks

Link to comment
Share on other sites

Thanks fo your answer.

Your workaround helps avoid GDI leaks when I call GetPicture and pass in it

CHART_BITMAP parameter but when I pass CHART_METAFILE then it doesn't help

and 2 GDI object leak per time. The saving as bitmap gives low qualities of

bitmap therefor I can't use it. I try using Export method and save bitmap in

the stream ( I read that it's possibly in the documentation ). In my test

project I have done following

CComVariant vt1;

vt1.vt = VT_UNKNOWN;

vt1.punkVal = pStream;// this interface inherit from IStream interface

m_Chart.Export( ChartfxLib::CHART_METAFILE, vt1 );

but Export returns E_FAIL, Where am I wrong?

Thanks

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...