Software FX Posted January 24, 2001 Report Share Posted January 24, 2001 You can use the GetPicture method whether the chart is visible or not, the chart must however have a size. If you are using the DLL, you need to call CreateWnd before calling GetPicture to give the chart a size, the window doesn't need to be visible. To get a picture from the chart without creating a window (using the DLL), you need to use the Paint method and draw to your own HDC containing a bitmap. Here is how, using the <#B>Paint method<#/B> you can obtain an image of the chart without ever creating a window for it. HDC hScreenDC, hMemDC; HBITMAP hBmp,hOldBmp; RECT rc; SetRect(&rc,0,0,ImageWidth,ImageHeight); hScreenDC = GetDC(NULL); hMemDC = CreateCompatibleDC(hScreenDC); hBmp = CreateCompatibleBitmap(hScreenDC,rc.right,rc.bottom); hOldBmp = (HBITMAP) SelectObject(hMemDC,hBmp); // Draws the chart into memory (Bitmap) m_pChartFX->Paint((long)hMemDC,0,0,rc.right,rc.bottom,CPAINT_BKGND,0); // ****************** // At this point, hBmp contains an image of the chart. Add your code that stores or process this image HERE ! // ****************** ReleaseDC(NULL,hScreenDC); SelectObject(hMemDC,hOldBmp); DeleteDC(hMemDC); DeleteObject(hBmp); Frank SFX "Jeff Weger" <jweger@vetronix.com> wrote in message news:H7$U67JhAHA.1716@sfxserver.softwarefx.com... > Does anyone know how to use the method GetPicture when the graph is not > visible? > Thanks. > > > Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.