Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

DPI in bitmap output

edited June 2015 in General
Hello,

if I select DeviceType := 'PNG' (or 'BMP' or 'GIF' or 'JPEG') I obtain page
files with a resolution of 794 x 1123 pixels, that correspond to 96 DPI.
How can I increase the resolution to 300 DPI (corresponding to 2480 x 3507
pixels)?

Thanks.

--
Andrea Nini

Comments

  • edited June 2015
    Hi Andrea,

    By default the Image Device(s) export each page at 100% according to the
    screen resolution which is generally 96 ppi. You can increase the scale
    used by altering the TppImageDevice.Scale property.

    For instance, increasing the scale to 3.125 (300 / 96) should give you a
    2480 x 3507 image.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2015
    Wed, 03 Jun 2015 09:32:13 -0600, Nico Cizik (Digital Metaphors) wrote:


    Currently I print to an image file with this code:

    ppReport1.DeviceType := 'PNG';
    ppReport1.ShowPrintDialog := False;
    ppReport1.TextFileName := 'c:\test.png';
    ppReport1.Print;

    How can I set the TppImageDevice.Scale property? Can you make me an
    example?

    Thanks.

    --
    Andrea Nini
  • edited June 2015
    Wed, 3 Jun 2015 18:11:26 +0200, Andrea Nini wrote:


    I have found this example and now I've understood the procedure:

    http://www.digital-metaphors.com:8080/index.php?title=Output/Image/Image_Device_Fundamentals

    Thanks.

    --
    Andrea Nini
  • edited June 2015
    Hi Andrea,

    I apologize for the delayed response.

    In addition to the method used in the example, you can access the file
    device (Image Device) using the OnFileDeviceCreate event.

    For example...

    procedure TForm1.ppReport1FileDeviceCreate(Sender: TObject);
    begin
    if (ppReport1.FileDevice is TppImageDevice) then
    TppImageDevice(ppReport1.FileDevice).Scale := 3.125;

    end;

    Best Regards,

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