Jump to content
Software FX Community

GetPicture and leak of GDI objects

User (Legacy)

Recommended Posts


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


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?


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...