Jump to content
Software FX Community

Printing


User (Legacy)

Recommended Posts

Is there a way of printing the current scrollview only?

If I try printing I can either get the whole set of data squashed on one

page or 10's of pages.

I realise the PrintIT method returns the last point printed and so you can

print each page individually as in the printing demo supplied with the

control.

However I would like to just print the page(s) that cover the current

scrollview window!

Another idea I thought of was maybe to export the chart as a meta file and

print that!?

Any help is appreciated.

Andy.

Link to comment
Share on other sites

The problem here is that the dimensions of a printer page doesn't usually 

match the dimension of your window.

It would be odd that by resizing your window you would get a different

print-out, this is what would happen if we printed the windows contents.

The PrintIt method allows you to print one page that "contains" the current

view by specifying -1 in both the From and To parameters. This, however,

will print the chart in the page conserving the physical scale (relationship

between physical measures e.g. inches and units in the chart axes), it will

print from the first visible point on. Since the size of the page is usually

bigger you will get more points that you see in the screen, specially if you

are printing in landscape mode.

--

FP

Software FX

Link to comment
Share on other sites

Hmmm, Doesn't appear to work!?

If I use ...

CommonDialog1.ShowPrinter

ChartFX1.Printer.hDC = CommonDialog1.hDC

ChartFX1.PrintIt -1, -1

Then I get a printout in black only and always starting from the first point

on the chart even though the view is way past the first point?

Andy.

"SoftwareFX Support" <noreply@softwarefx.com> wrote in message

news:sduiHA7rEHA.2576@webserver3.softwarefx.com...

> The problem here is that the dimensions of a printer page doesn't usually

> match the dimension of your window.

>

> It would be odd that by resizing your window you would get a different

> print-out, this is what would happen if we printed the windows contents.

>

> The PrintIt method allows you to print one page that "contains" the

current

> view by specifying -1 in both the From and To parameters. This, however,

> will print the chart in the page conserving the physical scale

(relationship

> between physical measures e.g. inches and units in the chart axes), it

will

> print from the first visible point on. Since the size of the page is

usually

> bigger you will get more points that you see in the screen, specially if

you

> are printing in landscape mode.

>

> --

> FP

> Software FX

>

>

Link to comment
Share on other sites

Any more ideas regarding printing because I still have this problem!?

The color problems was a simple mistake on my part that I hadn't set FORCE

COLORS to true, but simply printing what I see on screen has completed

baffled me!

The ChartFX1.PrintIt -1, -1 method does not work, this is the scenario...

I have a chart that displays X as time 00:00 to 23:59 and Y as acceleration,

this is to show the acceleration of a vehicle at any particualar time within

the 24hrs.

The view could be set to show say 1hour of the 24 and that's what I would

like to print, however when I try and print I get just the first page from

00:00 and the scollbar also snaps back to 00:00.

If I print with the lLastPoint = ChartFX1.PrintIt(nPage, nPage) method it

returns the same amount of points that IS in the series, even though it

doesn't actually print them all?

The only solution I can come up with is to capture the screen as a metafile

and print via a report, messy but should work.

If I used PrintIT(0,0) then I get around 100 pages of print showing the

whole series of data, the only other solution I can think of is to print to

a PDF printer then use the PDF viewer to select the actual page I want.

Any help would be very much appreciated!

Andy.

"Andy Pierrepoint" <andy@microtop.co.uk> wrote in message

news:%23%23n%236nFsEHA.3136@webserver3.softwarefx.com...

> Hmmm, Doesn't appear to work!?

>

> If I use ...

>

> CommonDialog1.ShowPrinter

> ChartFX1.Printer.hDC = CommonDialog1.hDC

> ChartFX1.PrintIt -1, -1

>

> Then I get a printout in black only and always starting from the first

point

> on the chart even though the view is way past the first point?

>

> Andy.

>

> "SoftwareFX Support" <noreply@softwarefx.com> wrote in message

> news:sduiHA7rEHA.2576@webserver3.softwarefx.com...

> > The problem here is that the dimensions of a printer page doesn't

usually

> > match the dimension of your window.

> >

> > It would be odd that by resizing your window you would get a different

> > print-out, this is what would happen if we printed the windows contents.

> >

> > The PrintIt method allows you to print one page that "contains" the

> current

> > view by specifying -1 in both the From and To parameters. This, however,

> > will print the chart in the page conserving the physical scale

> (relationship

> > between physical measures e.g. inches and units in the chart axes), it

> will

> > print from the first visible point on. Since the size of the page is

> usually

> > bigger you will get more points that you see in the screen, specially if

> you

> > are printing in landscape mode.

> >

> > --

> > FP

> > Software FX

> >

> >

>

>

Link to comment
Share on other sites

Is your chart an X/Y chart  ? What I mean is: Are you passing X-Values to 

your chart ?

I think the only way to achieve what you want is to use the Paint method.

The Paint method draws at the current scroll position, using the same

scaling and receives a rectangle and a device context in which to print the

chart.

Since you already have the DC, it will be easy for you to use this method.

The Paint method just draws the chart into a DC, it does not feed new pages

or initializes the printer job. As a matter of fact the Paint method is

designed so that you can print the chart along with your own objects in the

same page.

For more information please check the documentation on the Paint Method.

There is a section in the Programmer's Guide under "Printing Charts -> Tips

& Tricks" that explains the Paint method extensively. Here is some code

extracted from that section:

Sub PrintFillingPage ()

Dim l, r, t, b As Integer 'left,right,top and bottom

Printer.Print ""

px = Printer.TwipsPerPixelX

py = Printer.TwipsPerPixelY

w = Printer.Width

h = Printer.Height

gap = 100 / px

t = gap

b = ((h / 2) / py) - gap

l = gap

r = (w / px) - gap / 2

ChartFX1.Paint Printer.hDC, l, t, r, b, CPAINT_PRINT, 0

t = b

b = (h / py) - gap

ChartFX1.Paint Printer.hDC, l, t, r, b, CPAINT_PRINT, 0

Printer.EndDoc

End Sub

This code prints two charts in one page.

--

FP

Software FX

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...