OnBeforeDrawChart rendered bitmap missing on print

TeeChart for ActiveX, COM and ASP
Post Reply
jorn
Newbie
Newbie
Posts: 6
Joined: Mon Jul 05, 2004 4:00 am
Location: Norway

OnBeforeDrawChart rendered bitmap missing on print

Post by jorn » Fri Jan 28, 2005 9:15 am

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

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Feb 01, 2005 10:22 am

Hi Steffen,

to see that work please create an .exe file from your VB project and print from there.

jorn
Newbie
Newbie
Posts: 6
Joined: Mon Jul 05, 2004 4:00 am
Location: Norway

Post by jorn » Tue Feb 01, 2005 11:45 am

Pep wrote:to see that work please create an .exe file from your VB project and print from there.
Maybe I posted my original question in the wrong forum.

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

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Feb 02, 2005 11:34 am

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 ?

jorn
Newbie
Newbie
Posts: 6
Joined: Mon Jul 05, 2004 4:00 am
Location: Norway

Post by jorn » Wed Feb 02, 2005 3:20 pm

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

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

Post by Narcís » Wed Feb 02, 2005 3:37 pm

Hi Steffen,

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
Image Image Image Image Image Image
Instructions - How to post in this forum

jorn
Newbie
Newbie
Posts: 6
Joined: Mon Jul 05, 2004 4:00 am
Location: Norway

Post by jorn » Fri Feb 04, 2005 7:23 am

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

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Feb 11, 2005 1:01 pm

Hi Steffen,

one way to do this could be using an Annotation tool (which allows you to set an image), setting its size manually.

Post Reply