Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   teil eines bitmaps in ein anderes kopieren (https://www.delphipraxis.net/117594-teil-eines-bitmaps-ein-anderes-kopieren.html)

DeddyH 22. Jul 2008 17:30

Re: teil eines bitmaps in ein anderes kopieren
 
Da Du anscheinend nur ein Handle auf eine Bitmap hast und ich keine weitere Idee dazu (oder aktuell ein Brett vorm Kopf), muss ich leider passen :( .

lbccaleb 22. Jul 2008 17:45

Re: teil eines bitmaps in ein anderes kopieren
 
kann ich denn aus einem bitmaphandle irgendwie nen devicekontext erstellen??

Medium 22. Jul 2008 19:19

Re: teil eines bitmaps in ein anderes kopieren
 
CreateCompatibleDC mit Parameter nil erzeugt dir einen passenden DC, und mit SelectObject kannst du das HBitmap in den DC selektieren. Ich habe es nicht getestet, aber ich kann mir gut vorstellen, dass dies der Weg ist. Einen DC zu einem Bitmap gibt es nämlich nicht, aber einem DC kann man so ein Bitmap zuordnen.

SirThornberry 22. Jul 2008 19:27

Re: teil eines bitmaps in ein anderes kopieren
 
ansonsten sollte es auch so gehen:
Delphi-Quellcode:
var
  lBitmap: TBitmap;
begin
  lBitmap := TBitmap.Create();
  try
    lBitmap.Handle := BitmapHandle;
    try
      //Now you can work with lBitmap.Canvas.Handle
    finally
      lBitmap.Handle := 0;
    end;
  finally
    lBitmap.Free;
  end;

Medium 22. Jul 2008 19:30

Re: teil eines bitmaps in ein anderes kopieren
 
Ist halt die Frage ob er direkt mit dem GDI arbeiten möchte/muss, oder sich das Polster von Delphi gönnen kann :)

Namenloser 22. Jul 2008 23:02

Re: teil eines bitmaps in ein anderes kopieren
 
Zur Not in die Sourcen von TBitmap schauen, falls man daraus schlau wird.

lbccaleb 22. Jul 2008 23:41

Re: teil eines bitmaps in ein anderes kopieren
 
nee alles ohne tbitmap, nur winapi...

mit tbitmap, hab ichs schon ;-)


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:09 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz