Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#8

AW: BitBld und Anzeige in Image

  Alt 11. Apr 2011, 20:39
Hallo,

Die Zeile

Image2.Picture.Bitmap := bmp2;

stimmt schon. Im Setter des Bitmaps wird das zugewiesene Bitmap assigned.
Daran liegts nicht.

Ich tippe mal, dass es so gehen könnte:
Delphi-Quellcode:
procedure TForm1.Button5Click(Sender: TObject);
var breite, hoehe: integer;
begin
  breite := bmp1.Width-5;
  hoehe := bmp1.Height-7;

  // Maße von bmp2 setzen
  bmp2.Width := breite;
  bmp2.Height := hoehe;

  BitBlt(bmp2.Canvas.Handle,0,0,breite,hoehe,bmp1.Canvas.Handle,0,0,SRCCOPY);
  Image2.Picture.Bitmap := bmp2;
end;
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat