Home General

Preview image on low resolution screen

edited January 2011 in General
Hello all,

I am using D7 with RB 11.05.
I have a report which uses several 24 bit resolution images as background.
The report runs and prints fine but I have some customers
which use my application in a terminal server environment,
where the server graphic resolution is setted to 8 bit.
In these environments, in the print preview, the image
quality is so much degradated (it renders like a totally
green block) that users can't read values on the report.
I've asked them to enhance their server resolution but they
argue that, using a graphic program, the same images are
shown better. I've tested it and this is true.
If I open on their systems, with ms paint or something similar,
the original 24 bit images degradate more smoothly, they remain
readable.
So it seems that the RB print preview does something with images
that prevent a smooth aliasing..
Are there any TppReport options I can set to try to handle even
this scenario ?
Thanks
Bye
Nicola

Comments

  • edited January 2011
    Hi Nicola,

    I did some testing on my machine running a simple app in 256 color
    compatibility mode. It seems this behavior is limited to versions of Delphi
    7 and earlier. Later versions of Delphi process 24 bit images in 8 bit
    resolution correctly. This led me to believe that perhaps the Delphi image
    conversion process was to blame. ReportBuilder converts all non-metafile
    images to bitmaps before drawing them to the screen so if you are using a
    JPEG or GIF, RB is converting it (via Delphi routines) to a bitmap.

    In my testing, manually converting a JPEG image to a bitmap, then adding
    that image to the report (with DirectDraw set to False) produced a higher
    quality output.

    Regards,

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

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2011

    Hi Nico,

    Thank you for your time.
    I did some tests too.
    I've made a simple test project with two Timage components.
    Both of them hold the same jpg (yes it is a jpeg, forgot to tell in the
    first message), but the first is setted from the delphi ide in
    the "standard" way, the second by code with code copied from rb ppDrwCmd
    unit (TppDrawImage.GetGraphicAsBitmap: TBitmap).
    The timage standard shows well, while the second one has the problem.
    I've putted the two timage components in a pagecontrol in two separate
    tabsheet.
    If i switch from the tabsheet with the problem to the one with the
    standard component and then I come back, the problem disappears.
    There should be an event, in the timage code, that fix some way
    the palette.
    I've seen, in the vcl timage source, something like :
    if FDrawing then
    ParentForm.Perform(wm_QueryNewPalette, 0, 0)
    else
    PostMessage(ParentForm.Handle, wm_QueryNewPalette, 0, 0);
    )
    but i've tried including this call in my test project with no success...


  • edited January 2011
    Hi Nicola,

    Sorry if I was unclear. The workaround I was suggesting was to only use
    Bitmaps on your report by converting your JPEGs in a separate application
    (i.e. Photoshop). This way you remove the need to use the
    GetGraphicAsBitmap routine which (using Delphi routines) converts the JPEG
    to a Bitmap and seems to be causing the issue.

    Another alternative would be to upgrade your version of Delphi.


    Regards,

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


    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2011
    I'll try and let you know the results.
    Thanks you very much
    Bye

  • edited January 2011

    Hi Nico,

    Using a bitmap the defect disappears.
    Unfortunately the bitmap is also bigger in size and this makes
    the report source more "heavy" (i've a system to deploy report
    to customers: having bigger reports means slower upgrade time).
    Do you think that trying to extract the vcl Timage logic is not
    convenient/possible/viable ?

  • edited January 2011

    Hi,

    Are there any third party TppImage-like components I can use that may
    not have this problem ?
    My requirement is keep a jpg (or png or whatever compressed format)
    format keeping a reasonable quality (in preview) even in machine
    with low video settings.
    If so I give them a try.
    Thanks
    Nicola

  • edited January 2011
    PS
    this third party component should be for D7 and RB 11


This discussion has been closed.