Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

print stretched graph image

I'm looking for a way to print a cwgraph stretched on a complete page ( larger then screen size)
Is there one?
0 Kudos
Message 1 of 5
(3,194 Views)
Under the directory where you installed Measurement Studio, look at the example project under VC\Examples\Ui\Common\Printing. The dialog class has a OnPrintWysiwyg method and a OnPrintBestFit method. I think that the OnPrintBestFit method will demonstrate what you're looking for.

- Elton
0 Kudos
Message 2 of 5
(3,194 Views)
I have component works starter kit , So this example is not available, can please you provide a copy?
0 Kudos
Message 3 of 5
(3,194 Views)
Hi Again,

I found the example on a demo disk. For some reason the printout only uses half of the page (a4)either on landscape or portrait. What am I missing?
0 Kudos
Message 4 of 5
(3,194 Views)
To update the example code so that it behaves differently from only using half of the page like you're seeing, look at this section of the code in OnPrintBestFit:

if (bResizeGraph) {
// create a rectangle to resize the graph to (on the screen)
CRect rcNew;
rcNew.left = 0;
rcNew.top = 0;
rcNew.right = (long)(cInchesWide * logicalPixelsPerInchX_Screen);
rcNew.bottom = (long)(cInchesTall * logicalPixelsPerInchY_Screen);

// resize the graph so it will render larger (with more detail)
// the FALSE tells it to not redraw
m_Graph.MoveWindow(rcNew, FALSE);
}

// Calculate a rectangle (in printer coordinates) to print the
// graph in.
rc.left = 0;
rc.top = 0
;
rc.right = (long)(cInchesWide * logicalPixelsPerInchX_Printer);
rc.bottom = (long)(cInchesTall * logicalPixelsPerInchY_Printer);

Adjust the calculation for the rcNew.bottom and rc.bottom according to what you want.

- Elton
0 Kudos
Message 5 of 5
(3,194 Views)