...draw a bitmap on the desktop?
Author: Rohrbach Cedric
procedure TForm1.Button1Click(Sender: TObject);
var
Picture: TPicture;
Desktop: TCanvas;
X, Y: Integer;
begin
// Objekte erstellen
// create objects
Picture := TPicture.Create;
Desktop := TCanvas.Create;
// Bild laden
// load bitmap
Picture.LoadFromFile('bitmap1.bmp');
// Gerätekontex vom Desktop ermitteln
// get DC of desktop
Desktop.Handle := GetWindowDC(0);
// Position des Bildes
// position of bitmap
X := 100;
Y := 100;
// Bild zeichnen
// draw bitmap
Desktop.Draw(X, Y, Picture.Graphic);
// Gerätekontex freigeben
ReleaseDC(0, Desktop.Handle);
// Objekte freigeben
// release objects
Picture.Free;
Desktop.Free;
end;
printed from
www.swissdelphicenter.ch
developers knowledge base