PrintEnhancedMetafile vs DPlot_Command

Beta releases, announcements and anything else that doesn't fit below. Please read the <B>Welcome</B> topic.
Post Reply
GregoryG
Posts: 4
Joined: Mon Dec 08, 2014 7:51 am

PrintEnhancedMetafile vs DPlot_Command

Post by GregoryG »

I'm writing an interface to graph complex data. I'm using BTEST4 to figure out how to do different tasks. My question is what are the advantages vs disadvantages of using PrintEnhancedMetafile vs DPlot_Command printing.

*The enhancedmetafile call scales the result to the picturebox and that print routine in BTEST4 uses a margin of 0.25 (is this value critical?), but except for the resolution most other variables seem fixed (for example LOGPIXELSX & LOGPIXELSY and HORZRES & VertRES) from printer to printer. Given an 8.5x11 page size and 0.25 margins, it seems the ratios should be 1.31 (they are 1.02 and 1.25 respectively) Why is this and where did you get the numbers. Do I switch values to get landscape?

* If I send size and layout (WindowTile, FilePageSetup, & FilePrintMultiple) commands to dplot (for example to get a plot that is sized to the upper-left quadrant) does that information get passed to PrintEnhancedMetafile or is it wiped out by the code that sizes the metafile to the picturebox on the screen.

* Which gives the better vector file result? Typically users may print to PDF and our illustrators would tidy up the results for publication). I'm trying to get as close as possible to the end product.
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

The enhancedmetafile call scales the result to the picturebox and that print routine in BTEST4 uses a margin of 0.25 (is this value critical?)
No. I just picked 1/4" because that's safe on all printers I've tested. Most printer drivers will force specified margins smaller than the minimum to be the minimum. That's fine, but if you don't know what that value is beforehand you'll have scaling problems.
(for example LOGPIXELSX & LOGPIXELSY and HORZRES & VertRES)
Those are characteristics of the device, not variables. So yes, they are fixed except for cases where you can choose from multiple resolutions for the printer.
it seems the ratios should be 1.31 (they are 1.02 and 1.25 respectively) Why is this and where did you get the numbers. Do I switch values to get landscape?
I looked through the btest4 source and don't see 1.02 or 1.25 anywhere, so I'm not sure what you're talking about. If you're talking about SizeX and SizeY, those are based on the size of the client rectangle in btest4. If you resize the window you'll get different values.

Landscape mode is handled by the Print dialog (possibly under Preferences). You can change the orientation programmatically by manipulating the structure pointed to by the hDevMode member of the PrintDlg structure. Wow that was a mouthful. Honestly I'm not sure how to do this or if it is possible in VB.
* If I send size and layout (WindowTile, FilePageSetup, & FilePrintMultiple) commands to dplot (for example to get a plot that is sized to the upper-left quadrant) does that information get passed to PrintEnhancedMetafile or is it wiped out by the code that sizes the metafile to the picturebox on the screen.
Those commands only have meaning within DPlot. The enhanced metafile that gets passed back to your program is independent of the document window size in DPlot, and the printer settings only have meaning when printing from DPlot.
Which gives the better vector file result?
They should be pretty much identical if you make the client as large as possible. The demo bases the physical size of the metafile on the size of the target rectangle, so you may have better results (since you can easily control the size) printing from DPlot. But either way should be suitable for publication.
Visualize Your Data
support@dplot.com
Post Reply