Einzelnen Beitrag anzeigen

Muetze1
(Gast)

n/a Beiträge
 
#5

Re: C++ Übersetzung nach Delphi

  Alt 16. Feb 2008, 15:10
Mal in Theorie getippt:

Delphi-Quellcode:
function SaveBitmapFile(filename : PChar, image : PByte,width : DWord, height : dword): integer;
var
  p : array of byte;
  x,y : integer;
  bitm : TBitmap;
  lDest, lSource: PByte;
begin
  lSource := Image; // damit wir Image nicht verändern

  bitm := TBitmap.Create;
  try
    bitm.PixelFormat := pf32bit;
    bitm.Width := Width;
    bitm.Height := Height;

    for y:= 0 to heigth-1 do
    begin
      lDest := bitm.Scanline[y];

      Move(lSource^, lDest^, Width * 4);
  
      Inc(lSource, Width*4);
    end;
  finally
    bitm.Free;
  end;
end;
  Mit Zitat antworten Zitat