Canvas drawings not shown in BMP image

TeeChart for ActiveX, COM and ASP
Post Reply
psahay
Newbie
Newbie
Posts: 8
Joined: Tue Nov 18, 2003 5:00 am

Canvas drawings not shown in BMP image

Post by psahay » Thu May 18, 2006 7:31 pm

I'm drawing some arrows on top of my series using teechart canvas. Then I export the teechart as JPEG or BMP. But the arrows do not appear in the images. What should be done to get the image with the canvas drawings in it?

Function I used for drawing arrow:
m_tChart.GetCanvas().Arrow(TRUE, x, y+20, x, y, 5, 5, 0);

Function I used for creating BMP file:
m_tChart.GetExport().GetAsBMP().SaveToFile((LPCTSTR)fileName);

Some of the posts in the forum suggest putting canvas drawings into OnAfterDraw method. But in my version of teechart, I could not find OnAfterDraw method in any of the .h files.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri May 19, 2006 7:53 am

Hi psahay,

Please have a look at the examples at C:\Program Files\Steema Software\TeeChart Pro v6 ActiveX Control\Examples\Visual C++\Version 6 (default english installation path). Some of them use TeeChart's OnAfterDraw event.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

psahay
Newbie
Newbie
Posts: 8
Joined: Tue Nov 18, 2003 5:00 am

Post by psahay » Fri May 19, 2006 6:57 pm

Hi Narcis,

I added the OnAfterDraw method like this, but this method never gets invoked.

in .h file:
protected:
DECLARE_EVENTSINK_MAP()

in .cpp file:
BEGIN_EVENTSINK_MAP(CClockDataBaseWindow, CWnd)
//{{AFX_EVENTSINK_MAP(CClockDataBaseWindow)
ON_EVENT(CClockDataBaseWindow, IDC_TCHART1, 1 /* OnAfterDraw */, OnOnAfterDrawTchart1, VTS_NONE)
//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()

void CClockDataBaseWindow::OnOnAfterDrawTchart1()
{
// canvas drawing code
}

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon May 22, 2006 8:45 am

Hi psahay,

Have you looked at the examples I pointed you in my previous post?
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

psahay
Newbie
Newbie
Posts: 8
Joined: Tue Nov 18, 2003 5:00 am

Post by psahay » Thu May 25, 2006 7:04 pm

Hi Narcis,

The OnAfterDraw method worked for me. I was using a wrong window id in my code which I discovered later.

Thanks for the help.

Regards,
Pratyush.

Post Reply