Einzelnen Beitrag anzeigen

Benutzerbild von _frank_
_frank_

Registriert seit: 21. Feb 2003
Ort: Plauen / Bamberg
922 Beiträge
 
Delphi 3 Professional
 
#6

Re: TImage - Bildgröße anpassen

  Alt 5. Apr 2009, 12:03
z.b. mit einem temporären bitmap:

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var bmp{,bmp2}:TBitmap;
begin
  bmp:=TBitmap.create;
  bmp.width:=image1.width*2;
  bmp.height:=image1.height*2;
  stretchblt(bmp.canvas.handle,
    0,0,bmp.width,bmp.height,
    image1.picture.bitmap.canvas.handle,
    0,0,image1.picture.bitmap.width,image1.picture.bitmap.height,
    srccopy);
  antialiasing(bmp,bmp.Canvas.ClipRect,50);
  image1.Picture.Assign(bmp);
  bmp.free;
end;
das Stretch/Proportional-Property must natürlich deaktivieren und ggf. das ursprungsbitmap sichern, da das ja überschrieben wird.

Gruß Frank
  Mit Zitat antworten Zitat