News:

Interested in some really terrific mobile apps? Visit www.turboapps.com for details.

Main Menu

Margin Space calculation for image export

Started by Josh T., July 30, 2010, 01:32:35 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Josh T.

TurboCAD drawings can be exported as images at an exact scale, if the extra space that TurboCAD adds to the exported image is taken into account.  The following method avoids the need to resize an image after exporting; cropping (perhaps via a canvas size modification) is all that should be necessary to prepare the image for use.

The method:

Within any image export dialog, each desired final dimension (example 17" sheet size at 600dpi = 10,200 pixels) needs exactly 2% added to it, so that a 10,200 pixel desired size would need to be set at 10,404 in the dialog (normal dimension x DPI, then add 2%).  For this to work in Model Space, you will need to draw a zero-width border representing the outer edge of a sheet of paper around the drawing's contents (in Paper Space the Viewport serves this purpose).    After the export, an image editor can be used to get rid of the extra blank space, leaving you with what should be 10,200 pixels.

The attached TCW and GIF files depict another example, using 8 1/2 x 11 as the intended sheet size at 300 dpi (2550 x 3300).  Adding 2% for the margin, the exported size was set to 2601 x 3366.  Model Space and Paper Space yield identical images, as well, since the visible drawing sheet in Paper Space has no apparent effect on the image export; what matters is the aspect ratio of the graphics themselves.

NOTE:  This method has now been tested in both v11.2 and v17.1, with identical results for all image formats (JPG, GIF, BMP, PNG)


Some hints & tips...

1)  If exporting from Paper Space using a single viewport, it is easiest to deal with a viewport that fully coincides with the drawing sheet, leaving no white space uncovered.  If using multiple viewports, you will want to draw a separate border the same size as the drawing sheet around the other viewports.

2) To avoid having to delete the zero-width border or viewport border after cropping your exported image, you can set your Line Style pattern to $invisible$ before exporting.
Josh T.
meatballrocketry.com
TC Pro 18.2 & Platinum 2016

Orion20036

Seems to be working okay with this method Josh, will try it out on a number of different sizes tomorrow. This has reduced the cropping to one process now. Many Thanks.


Mike Geraghty.

Orion20036

Tried this on a number of different image sizes now Josh, and the method works well with the 2% allowance. It is well worth putting a flag on this tip if that is possible.

Josh T.

Quote from: Michael Geraghty on August 01, 2010, 08:12:25 AM
Tried this on a number of different image sizes now Josh, and the method works well with the 2% allowance. It is well worth putting a flag on this tip if that is possible.

Glad to hear it, Mike.  I guess moderators would be in charge of flagging, right?
Josh T.
meatballrocketry.com
TC Pro 18.2 & Platinum 2016