Einzelnen Beitrag anzeigen

zeina

Registriert seit: 8. Jun 2018
56 Beiträge
 
#1

Fehler bei Bereichsprüfung für ein bitmap drehen

  Alt 27. Feb 2019, 10:55
Hallo,
ich habe ein Problem und zwar,dass mein programm ein fehler Meldung (Fehler bei Bereichsprüfung)ausliefert.

Delphi-Quellcode:
type TRGBarray = array[0..0] of TRGBQuad;


procedure TFormFoto.rotate90(const Source:TGraphic ; Bmp: TBitmap);
var P : PRGBQuad;
  y, x, h, b: integer;
  Rowout : ^TRGBarray;
  sourcebmp : TBitmap;
begin
  sourcebmp := TBitmap.Create;
  try
    sourcebmp.PixelFormat := pf32bit;
    sourcebmp.Height := Source.Height;
    sourcebmp.Width := Source.Width;
    sourcebmp.Canvas.Draw(0, 0, Source);
    Bmp.PixelFormat := pf32bit;
    b := sourcebmp.Height;
    h := sourcebmp.Width;
    Bmp.Height := h;
    Bmp.Width := b;
    for y := 0 to (h - 1) do begin
      rowout := Bmp.ScanLine[y];
      p := sourcebmp.ScanLine[sourcebmp.height-1];
      inc(p, y);
      for x := 0 to (b-1) do begin
      rowout[x] := p^;
      inc(p, h);
    end;
    end;
  finally
    sourcebmp.Free;
  end;
end;

Geändert von zeina (27. Feb 2019 um 11:01 Uhr)
  Mit Zitat antworten Zitat