Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

print cwgraph

i'm using the following code to print my graph. But the result i obtain is not is not what i expect... because the caption appears in a to big police..i want to know if there is a way to reduce that?
thanx


Printer.ScaleMode = vbCentimeters
Printer.Orientation = cdlLandscape
CWGraph_Prod.Images(3).Color = vbWhite
CWGraph_Prod.Font.Size = 2
Printer.PaintPicture CWGraph_Prod.ControlImage, 0, 0, 28, 18
CWGraph_Prod.Images(3).Color = vbBlack
Printer.EndDoc
0 Kudos
Message 1 of 7
(3,997 Views)
It may be a typo, but "the caption appears in a to big police" does not make much sense. W/o a clear problem description it is difficult to asses the situation.

Also, please realise that generally, when you have printing issues with specific printers when using the CVI printing functions, it is almost always caused by the specific driver implementation they are using. I know that this may be hard to believe that so many different printer drivers are the cause and not CVI, but the following informatoin explains why.

CVI creates standard Windows GDI instructions for rending text and images on display devices and does not directly interact with the driver, it is up to the driver to be fully compatible with the Windows GDI subsystem standard and properly render all of the instructions. The printing functionality of CVI has remained unchanged for quite some time and has stuck with this method of using GDI only to maintain the highest level of compatibility with all output devices, but sadly many of the newer driver implementations have forgone GDI compatiblity to optimize their drivers to work best with certain applications. Now, if you think about it, since an older driver often can correctly output the graphics and text without incident (depending on when the printer was originally manufactured there may not be an older driver), it must be a change in the new driver that is causing this to happen, and the printer itself nor CVI is the problem.

The only thing I can really suggest is trying using the SetPrintAttribute function to change some of the graphics printing attributes (changing text printing attributes is done in the same fashion), such as enabling bitmap printing and the print area size, as suggested in the following KB:

Link -> http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/7112309d1e886e5e862569ae006f77c0?OpenDocument

Explanation of GDI printing is found at the link below:

Link -> http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/0b33d74eefd61cb9862565fa00740196?OpenDocument

I hope this information helps and I wish you luck!

Amaury R.
NI Applications Engineer
0 Kudos
Message 2 of 7
(3,997 Views)
this apply to cvi but i'm using Visual basic 6 ....
0 Kudos
Message 3 of 7
(3,997 Views)
My appologies for looking at your first message a little too quickly to realise that it was not CVI.

However, I still don't understand the problem description.
0 Kudos
Message 4 of 7
(3,997 Views)
the problem is that the Printer.PaintPicture i use return a bitmap of the graph and this on is enlarge to take full page at the moment of print..(sorry for my english...!) but it enlarge also the text...
i found a "solution" by usiong small font size 2 so then whan it's enlarge it's quiet ok ...but then the title of the y axis cant't be read beacause of the orientation. It seems that in small font whan it's not write horizontally the result is not correct and in font 2 it's not readable...!!
0 Kudos
Message 5 of 7
(3,997 Views)
I have tried out the code that you sent me (and attached my project to this message). I was not able to reproduce your problem. Please see if you have the same problem with the attatched project.
0 Kudos
Message 6 of 7
(3,997 Views)
thank you for your effort but i can't load your project...! it tell me i haven't got the same version of cwui.ocx...
Mine is 3.0.1(549)
is yours newest ?
0 Kudos
Message 7 of 7
(3,997 Views)