Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cesar
  Where is Cesar?
 
 Brazil
 Cesar
 To: tom knauf
  Where is tom knauf?
 
 Germany
 tom knauf
 Tags
Subject: RE: How to convert report to jpg small size
Thread ID: 319377 Message ID: 320237 # Views: 32 # Ratings: 0
Version: Visual FoxPro 9 Category: Reports and Printers
Date: Wednesday, September 14, 2011 5:47:41 PM         
   


> >
> > Hi Tom,
> >
> > Yousfi is absolutely right. You can do that image conversion with just a few commands using GDI+.
> > Don't forget that if you have the ReportOutput.App file in ypur system, you already have the _GdiplusClassLibrary !!!
> >
> > See how easy it is for you:
> >
> >
LOCAL lcSource, lcDestination, lcReportFile
> > lcSource = GETPICT()
> > lcDestination = JUSTPATH(lcSource) + "\_" + JUSTSTEM(lcSource)
> > 
> > IF VARTYPE(_REPORTOUTPUT) = "U"
> > 	_REPORTOUTPUT = ADDBS(HOME()) + "ReportOutput.App"
> > ENDIF
> >  
> > LOCAL loImage AS GpImage OF HOME() + ffc/_gdiplus.vcx
> > loImage = NEWOBJECT("GpImage", "ffc/_gdiplus.vcx", _REPORTOUTPUT)
> > loImage.CreateFromFile(lcSource)
> > * loImage.SaveToFile(lcDestination + ".jpg","image/jpeg")
> > * loImage.SaveToFile(lcDestination + ".bmp","image/bmp")
> > * loImage.SaveToFile(lcDestination + ".tif","image/tiff")
> > * loImage.SaveToFile(lcDestination + ".gif","image/gif")
> > * loImage.SaveToFile(lcDestination + ".png","image/png")
> > 
> > * JPEGs allow to choose the quality of the image
> > * Just try changing the value 70 for any onther that you wish
> > *                       use Integer values, from 1 to 100
> > loImage.SaveToFile(lcDestination + ".jpg","image/jpeg", "quality=70")

> >
> > The best is that the library is already there, you don't need another file to manage or distribute!
> > Hope that helps !
> >
> > Regards,
> >
> > Cesar
> > My Blog
>
> Hello,
>
> thanks for the tips, I agree, as much as possible with the fox.
>
> But how to make a series of JPGs from different sources (Scanner, webcam, Nikon DSLR) in different sizes all less then 250 KB without trying diff qualitys until it matches ?
>
> For that I use IV. And for converting PDF to JPG, and others....
>
> Best regards
> Tom
>
>
>
> regards
> tom

Hi Tom,

If you want only to reduce the sizes of your images, for sure Gdi+ can be useful.
All you need is to find the transformation ratio that IV did in your original image, and apply them in VFP.

Get one original image, and check the new Image resolution, and size. Then apply the same transformation using GDI+. If you want, get those info or send me the original version and the new one, so that we could find what IV did to your image.

Converting a PDF in image is more complicated. For that purpose, we'd need to use the PDF library used in FoxyPreviewer, a much more complicated task :-D

Regards,

Cesar
My Blog

COMPLETE THREAD

How to convert report to jpg small size Posted by Nandkishor Lande @ 9/8/2011 6:59:33 PM
RE: How to convert report to jpg small size Posted by Yousfi Benameur @ 9/8/2011 8:03:06 PM
RE: How to convert report to jpg small size Posted by tom knauf @ 9/14/2011 9:48:54 AM
RE: How to convert report to jpg small size Posted by Yousfi Benameur @ 9/14/2011 10:27:46 AM
RE: How to convert report to jpg small size Posted by Cesar @ 9/14/2011 12:56:20 PM
RE: How to convert report to jpg small size Posted by tom knauf @ 9/14/2011 5:38:09 PM
RE: How to convert report to jpg small size Posted by Cesar @ 9/14/2011 5:47:41 PM
RE: How to convert report to jpg small size Posted by tom knauf @ 9/14/2011 10:52:06 PM