Controling JPG size and Compression

edited July 2010 in Devices
Using Delphi 2010 and RB 12

Unable to find settings for JPG dimension and JPG compression to output to a
file in the documentation.

How do I do this?

Bruce

Comments

  • edited July 2010
    Hi Bruce,

    The image devices all contain a public property to directly access the image
    component. For instance the TppJPGDevice.JPEG property gives access to the
    TJPEGImage object it uses. You can access this property from the report
    object.

    TppJPGDevice(ppReport1.FileDevice).JPEG...

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2010
    Can you please give a more complete example of a routine including the var
    section from below a jpg compression and width settings.

    I can't get the compile past the TppJPGDevice.
    I think either I am missing a file in the units section or more likely I am
    not defining TppJPGDevice properly.

    Thanks
    Bruce


  • edited August 2010
    Hi Bruce,

    Take a look at the following articles/examples. The first is a general
    image export example showing how you can manually use each image device.
    The second shows how you might access the JPEG property of the device on the
    fly at runtime.

    http://www.digital-metaphors.com/rbWiki/Output/Image/Image_Device_Fundamentals

    http://www.digital-metaphors.com/rbWiki/Output/Image/How_To...Export_Gray_Scale_Jpegs

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2010
    Thank for the directions -

    I am getting successful compiles but when any of the following lines are hit
    during runtime it generates an error.

    TppJPGDevice(ppReport1.FileDevice).JPEG.CompressionQuality := 10;
    TppJPGDevice(ppReport1.FileDevice).JPEG.SetSize(100,200);
    TppJPGDevice(ppReport1.FileDevice).JPEG.Width := 200;
    TppJPGDevice(ppReport1.FileDevice).JPEG.Height := 100;

    All I am trying to do is have the image size match what is being printed
    which is the way it works when using the Waler extradevices add on. The
    only reason I am attacking this problem is the extradevices control has a
    Delphi 2010 version put not for RB12. Waler responded to an email many
    weeks ago that he would have the RB12 version shortly but I have seen
    nothing. I have sent around 6 emails and he has only responed once. Any
    idea what is going on with him?

    I am willing to do paid phone support to fix this but I am not getting my
    calls returned from Digital Metaphors. Is it a simpler option just to
    downgrade to RB11?

    Thanks
    Bruce




  • edited August 2010
    > I am getting successful compiles but when any of the following lines are

    which error?

    Ed Dressel
    Team DM
  • edited August 2010
    Hi Bruce,

    Where are you making these calls? You need to be sure when you access the
    file device that it has been created or else you will receive an error. A
    good place to access the file device is in the OnFileDeviceCreate event of
    the report.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2010
    As a starting point, try to download, build, and run the rbWiki code
    example. Then incrementally modify it, btuild and test at each step.

    http://www.digital-metaphors.com/rbWiki/Output/Image/How_To...Export_Gray_Scale_Jpegs



    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited August 2010
    After much time I have gotten what I need in image size and compression but
    it would be useful to have some explanations and it should be useful for
    your documentation as you make report builder improvements for outputing to
    different file types.

    I couldn't get the jpg image deminsion to match the the print jpg deminsion.
    No matter what I did in the report editor the jpg file created had the
    PaperHeight and PaperWidth of the "utScreenPixiels" setting in the "Units"
    property. I needed PaperHeight and PaperWidth to match the
    "utPrinterPixels" setting. I finally got it to match with the line

    TppJPGDevice(ppReport1.FileDevice).Scale := 3.126.

    My question is what exactly is the "scale" property designed to do?

    Thanks


    Bruce


    Thanks
    Bruce




  • edited August 2010
    Hi Bruce,

    Generally (with the exception of TIFF) images are not meant to be printed on
    their own. They are either viewed on screen or added to a larger document
    then printed. The Scale property allows the user to stretch or shrink the
    output image based on its actual size (PaperWidth, PaperHeight).

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.