Einzelnen Beitrag anzeigen

Rollo62

Registriert seit: 15. Mär 2007
4.116 Beiträge
 
Delphi 12 Athens
 
#4

AW: Fit image in control

  Alt 1. Feb 2017, 11:35
Maybe this helps to make calculations easier, if this is what you are looking for.

FitInto and PlaceInto are nice functions already in the library, but not very popular.

Zitat:
class function Empty: TRectF; inline; static;
{ This method is to be deprecated. It stretches current rectangle into designated area similarly to FitInto,
but only when current rectangle is bigger than the area; otherwise, it only centers it. }
function Fit(const BoundsRect: TRectF): Single; // deprecated 'Please consider using FitInto instead.';
{ Stretches current rectangle into the designated area, preserving aspect ratio. Note that unlike Fit, when designated
area is bigger than current rectangle, the last one will be stretched to fill designated area (while Fit would only
center it). }
function FitInto(const ADesignatedArea: TRectF; out Ratio: Single): TRectF;
http://docwiki.embarcadero.com/Libra...m.Types.TRectF

Rollo
  Mit Zitat antworten Zitat