Hallo,
vieleicht hilft Dir dieser Code, zur Ermittlung der neuen Größe.
Delphi-Quellcode:
function DestRect(DestWidth, DestHeight, SourceWidth, SourceHeight: Integer;
Center: Boolean): TRect;
var
cw, ch, w, h: Integer;
xyaspect: Double;
begin
cw := DestWidth;
ch := DestHeight;
w := SourceWidth;
h := SourceHeight;
xyaspect := w / h;
if w > h then begin
w := cw;
h := Trunc(cw / xyaspect);
if h > ch then begin
h := ch;
w := Trunc(cw * xyaspect);
end
end else begin
h := ch;
w := Trunc(ch * xyaspect);
if w > cw then begin
w := cw;
h := Trunc(ch / xyaspect);
end
end;
with Result do begin
Left := 0;
Top := 0;
Right := w;
Bottom := h;
end;
if Center then
OffsetRect(Result, (cw - w) div 2, (ch - h) div 2);
end;
Gruß Reinhold