Hi,
I have added a background picture to my chart by handling the OnBeforeDrawChart event. In the event handler I use the MFC CImageList::Draw() method to draw a bitmap onto the DC, which I get from CTChart.GetCanvas().GetHandleDC().
This works nicely on the screen and on the Print Preview (CTChart.GetPrinter().ShowPreview()), but on the printed paper, the bitmap image is astoundingly absent.
What should I do to make OnBeforeDrawChart()-rendered images appear on the printed paper?
--
Regards
Steffen Skov
senior consultant
Scandpower Petroleum Technology AS
OnBeforeDrawChart rendered bitmap missing on print
Hi Steffen,
to see that work please create an .exe file from your VB project and print from there.
to see that work please create an .exe file from your VB project and print from there.
Pep Jorge
http://support.steema.com
http://support.steema.com
Maybe I posted my original question in the wrong forum.Pep wrote:to see that work please create an .exe file from your VB project and print from there.
My project is a Visual C++ project, hence, I am always creating an .exe file, and printing from that...
--
Regards
Steffen Skov
senior consultant
Scandpower Petroleum Technology AS
Hi Steffen,
I've posted a VC++ example which prints fine using the OnBeforeDrawChart event into the news://steema.net/steema.public.attachments newsgroup, could you please test if it works fine for you ?
I've posted a VC++ example which prints fine using the OnBeforeDrawChart event into the news://steema.net/steema.public.attachments newsgroup, could you please test if it works fine for you ?
Pep Jorge
http://support.steema.com
http://support.steema.com
Thanks for posting your solution to the news server. I am able to download some of the messages from the server, while others refuse to come my way. As good ol' Murphy would have it, I am of course not able to retrieve the OnBeforeDrawChart example project.
If at all possible, could you please send it to ssk@scandpowerpt.com
Thank you.
--
Regards
Steffen Skov
senior consultant
Scandpower Petroleum Technology AS
If at all possible, could you please send it to ssk@scandpowerpt.com
Thank you.
--
Regards
Steffen Skov
senior consultant
Scandpower Petroleum Technology AS
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Steffen,
I've just sent the project to the requested e-mail address.
I've just sent the project to the requested e-mail address.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi Narcís,
thank you for your example project.
I made it compile by replacing the GUID of (what I expect is version 7 of) the TeeChart AX with that of version 6 in the resource file. I ran the example, and it worked fine.
However, I did not immediately find that it displays bitmap images in the chart, which is what I had trouble with. In my program I get the windows device context (DC), which the tee chart canvas provides for me, and use that for blitting a bitmap into the chart.
I guess it all comes down to this: Is it possible to use this device context also when printing, or would one have to use the drawing methods on the teechart panel interface? The panel interface does not seem to have any bitmap blitting methods, though, so that would be a tough one for me.
--
Kind regards
Steffen Skov
Senior Consultant
Scandpower Petroleum Technology AS
thank you for your example project.
I made it compile by replacing the GUID of (what I expect is version 7 of) the TeeChart AX with that of version 6 in the resource file. I ran the example, and it worked fine.
However, I did not immediately find that it displays bitmap images in the chart, which is what I had trouble with. In my program I get the windows device context (DC), which the tee chart canvas provides for me, and use that for blitting a bitmap into the chart.
I guess it all comes down to this: Is it possible to use this device context also when printing, or would one have to use the drawing methods on the teechart panel interface? The panel interface does not seem to have any bitmap blitting methods, though, so that would be a tough one for me.
--
Kind regards
Steffen Skov
Senior Consultant
Scandpower Petroleum Technology AS
Hi Steffen,
one way to do this could be using an Annotation tool (which allows you to set an image), setting its size manually.
one way to do this could be using an Annotation tool (which allows you to set an image), setting its size manually.
Pep Jorge
http://support.steema.com
http://support.steema.com