Page 1 of 1
Printing AX-V7 in .NET using the PrintDocument???
Posted: Mon Nov 29, 2004 12:29 pm
by 9523802
Hi all!
Is it possible to print Tcharts using the .net-printdocument, so I can use the .net print preview and all of the other document related stuff of VS?
I need to place more (>2) Tcharts and mixed graphics on a single page?
If yes, can somebody post me a short coding example for VB?
Thanks in advance!
Alex
Posted: Thu Feb 03, 2005 1:44 pm
by Pep
Hi Alex,
yes, this can be done. The best way is by exporting the Chart image to stream, and then when you need to print it, import the stream as an image and draw it on the Print Document, using the DrawImage method in the PrintPage event.
Posted: Thu Feb 03, 2005 3:56 pm
by 9523802
Hi Pep,
thanks for the hint. I came to a similar solution to print on multiple pages using this method.
If someone looks for the code I use:
Code: Select all
Dim TStream As New System.IO.MemoryStream
FGrafik.TChart1.Export.Image.Metafile.Save(TStream)
TStream.Position = 0
Dim be_test As New Imaging.Metafile(TStream)
e.Graphics.DrawImage(be_test, 25, 40, 250, 350)
be_test.Dispose()
But what I still want to know: I use a metafile format, this is according to the definition a real vector format. E.g. I draw in TChart a polygon (x/y), why do the lines are splitted up in x/y resultion? Instead of my 10 point polygon I get a 40 point polygon based on the resultion of the metafile. Why are the lines not a single line between my polgon points? Is the basis of a metafile still "pixel"?
Thanks another time!
Regards
Alex
Posted: Fri Feb 11, 2005 3:03 pm
by Pep
Hi Alex,
But what I still want to know: I use a metafile format, this is according to the definition a real vector format. E.g. I draw in TChart a polygon (x/y), why do the lines are splitted up in x/y resultion? Instead of my 10 point polygon I get a 40 point polygon based on the resultion of the metafile. Why are the lines not a single line between my polgon points? Is the basis of a metafile still "pixel"?
How can I see what you refer ? Could you please show me the code you're using to reproduce this behaviour ?
Posted: Tue Feb 15, 2005 3:33 pm
by 9523802
Hi Pep,
yes, of course. I think it's the best that I post two small pictures where you can see my problem. How can I send you these pictures?
Best regards
Alex
Posted: Tue Feb 15, 2005 3:41 pm
by narcis
Hi Alex,
Please post them at the
steema.public.attachments newsgroup available at
news://www.steema.net.
Thanks in advance.
Posted: Wed Feb 16, 2005 12:35 pm
by 9523802
Hi Pep,
images and questions are posted.
Narcis, thanks for the link.
Best regards
Alex
Posted: Mon Feb 28, 2005 2:33 pm
by 9523802
Hi Support!
Some comments to the pictures? Should I start a new thread?
Regards
Alex
Posted: Tue Mar 01, 2005 4:54 pm
by narcis
Hi Alex,
An example project has been attached to a reply to your message in the steema.public.attachments newsgroup.
Posted: Sat Mar 05, 2005 10:55 am
by 9523802
Hi Narcis,
thanks for the posting. This problem was still solved according Pep's hint (the same way like your posting).
Concerning the EMF quality I will start a new thread.
Regards
Alex