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

Conversion Routine

edited June 2005 in General
Hi,

I have a TppDBImage component. I want to take the Picture out of that image
and grab its height and width (easy enough) and then perform a calculation
that will convert this into a height and width that I can assign to the
TppDBImage component.

So in effect I want to do the following:

ppDBImage1.Height := ppDBImage1.Picture.Height
ppDBImage1.Width := ppDBImage1.Picture.Width <--- need to perform a
conversion to get the right unit type

I understand there is a ppUtils function set. Which of these do I use to
get the desired result? And an example would be great. Also is there any
documentation on these functions?

RB6.03 and Delphi 5

Thanks

Alex

Comments

  • edited June 2005

    Try setting spHeight and spWidth...

    ppDBImage1.spHeight :=
    ppDBImage1.spWidth :=

    For convenience the RB components have properties called spHeight and
    spWidth that are in screen pixels. The conversion is done internally. See
    ppPrnabl.pas.

    Internally RB stores everything as thousandths of mm.

    The DBImage.Height and Width are in Report.Units (whatever you have that set
    to). So another way solve conversion is to set Report.Units to
    utScreenPixels and then set the DBImage.Height and Width. Internally RB will
    perform the conversion.

    The ppUtils.pas unit contains utility routines that are used throughout RB.
    The primary conversion routines are ppFromMMThousandths, ppToMMThousandths.
    For examples of using these routine, use Delphi to perform a Find in Files
    on calls to these routines.





    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.