// This function stretches a bitmap with specified number of pixels // in horizontal, vertical dimension // Example Call : ResizeBmp(Image1.Picture.Bitmap , 200 , 200); // Diese Funktion zerrt eine Bitmap in die anzugebenden Pixel // Beispielaufruf : ResizeBmp(Image1.Picture.Bitmap , 200 , 200); functionTForm1.ResizeBmp(bitmp: TBitmap; wid, hei: Integer): Boolean; var
TmpBmp: TBitmap; ARect: TRect; begin
Result := False; try
TmpBmp := TBitmap.Create; try
TmpBmp.Width := wid; TmpBmp.Height := hei; ARect := Rect(0,0, wid, hei); TmpBmp.Canvas.StretchDraw(ARect, Bitmp); bitmp.Assign(TmpBmp); finally
TmpBmp.Free; end
; Result := True; except
Result := False; end
; end
;