AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Aus DIB ein Bitmap erzeugen

Ein Thema von minimops · begonnen am 14. Feb 2006 · letzter Beitrag vom 15. Feb 2006
 
minimops

Registriert seit: 22. Jan 2004
56 Beiträge
 
Delphi 2005 Professional
 
#1

Aus DIB ein Bitmap erzeugen

  Alt 14. Feb 2006, 22:38
Ich möchte Informationen aus dem Internet Explorer in mein Programm via Drag and Drop ziehen. Text + HTML klappen prima, nur mit den Bildern komme ich nicht zurecht.

Es wird immer nur ein weisses Rechteck angezeigt...

Delphi-Quellcode:
procedure TForm1.HandleDIB( dataObj : IDataObject; fetc : TFormatEtc );
var
   p : pointer;
   stgm : TSTGMEDIUM;
   BMIH : TBITMAPINFO;
   bmp :HBITMAP;
    _HDC, hDC : windows.HDC;
begin
      {Make certain the data rendering is available}
   if( dataObj.QueryGetData( fetc ) = NOERROR ) then
   begin
         {Get the data}
      dataObj.GetData( fetc, stgm );

         {Lock the global memory handle to get
           a pointer to the data}


      BMIH := TBITMAPINFO(GlobalLock(stgm.hGlobal)^);

      with bmih.bmiHeader do bmp:=CreateBitmap (biWidth,biHeight,biPlanes,biBitCount,@bmih.bmiColors);


        _HDC := GetDC(Self.Handle);
         hDC := CreateCompatibleDC(_HDC);
        SelectObject(hDC, bmp);

        BitBlt (hDC, 0, 0, bmih.bmiHeader.biWidth, bmih.bmiHeader.biHeight, img.Canvas.Handle, 0, 0, cmSrcCopy); // Nur zum Füllen von bmp
        BitBlt(_HDC, 0, 0, bmih.bmiHeader.biWidth, bmih.bmiHeader.biHeight, hDC, 0, 0, cmSrcCopy);

         {Finished with the pointer}
      GlobalFree( stgm.hGlobal );

         {Free the memory}
      ReleaseStgMedium( stgm );
   end;
end;
Was mach ich falsch????

Danke Axel
Angehängte Dateien
Dateityp: zip testpog_534.zip (2,3 KB, 15x aufgerufen)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:54 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz