Jump to content
Software FX Community

Re: GetPicture


Software FX
 Share

Recommended Posts

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

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