LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resize and print a large image in a report

A current project I'm working requires that a "report" be printed out for every "part" produced.  

Each "part" is photographed and a high quality (large) .jpg file is generated and cataloged on the hard drive.  A report with this image is then printed and shipped with the product as part of a QA process.  

Initially I used a command line argument to have Irfanview print the image only.  This was so easy.  Even printing in Landscape was simple.  Of course then I realized I would probably need a little more information than just the image.  

Looking at some examples of report generation and reading some of the problems others have had in the past, I figured it might be good to ask before I go stumbling around in the dark.  

The original images are 2288x1712 in size.

Is there any way to auto resize an image to "fit" onto a printed report?  

The only way I can think to do is to experiment with different sizes until I find something that fits and looks alright, then use either IMAQ tools or an Irfanview command to resize the image before appending it to the report.  

If anyone has any tricks for this one, I'd love to hear them.  

---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 1 of 5
(3,593 Views)
You can try ImageMagick.  This is a command line set of image manipulation tools that can be easily called by LabVIEW using System Exec.vi.  If you know your printer resolution, it should be fairly easy to rescale the images.  You can use the LabVIEW Read JPG File.vi to read the image into LabVIEW for analysis, if you want.  Be aware that your images will use about 15MBytes of RAM per copy, so be careful.  Good luck.
0 Kudos
Message 2 of 5
(3,579 Views)
If you want a pure G approach, you can try the resizing VI in the attached LLB. It doesn't do any image manipulation, so you might find it unsuitable for printing. It worked for display for me. From my tests with it, it takes about a second to process an image of that size.

___________________
Try to take over the world!
0 Kudos
Message 3 of 5
(3,575 Views)

tst,

Any chance you could save the resize1 vi in version 6.1?  Thanks, I have been looking for such a vi.

Pat

0 Kudos
Message 4 of 5
(3,459 Views)
Here, but like I said, it's a very stupid VI. It doesn't do any avareging or smoothing and it has no mathematical optimization (assuming that there is any). It just removes some of the elements. This has been good enough for displaying images, but might not be good for anything else, because you lose a lot of details.

___________________
Try to take over the world!
0 Kudos
Message 5 of 5
(3,449 Views)