Einzelnen Beitrag anzeigen

Benutzerbild von sx2008
sx2008

Registriert seit: 15. Feb 2008
Ort: Baden-Württemberg
2.332 Beiträge
 
Delphi 2007 Professional
 
#2

AW: Delphi Chromium Embedded - XE3

  Alt 25. Mai 2013, 18:23
Das Problem ist wohl, dass Pointer s keinen Datentyp hat.
Ungetestet (hab kein XE)
Delphi-Quellcode:
function CefGetBitmap(const browser: ICefBrowser; typ: TCefPaintElementType; Bitmap: TBitmap): Boolean;
var
  w, h, i: Integer;
  p : Pointer;
  s : PInteger; // Zeiger auf einen Integer mit 4 Byte
begin
  browser.GetSize(typ, w, h);
  Bitmap.PixelFormat := pf32bit; // Wichtig
  Bitmap.SetSize(w, h);

  GetMem(p, h * w * 4);
  try
    Result := browser.GetImage(typ, w, h, p);
    s := PInteger(p);
    for i := 0 to h - 1 do
    begin
      Move(s^, Bitmap.ScanLine[i]^, w*4);
      Inc(s);
    end;
  finally
    FreeMem(p);
  end;
end;
fork me on Github
  Mit Zitat antworten Zitat