Einzelnen Beitrag anzeigen

Basetyp

Registriert seit: 18. Apr 2012
12 Beiträge
 
#3

AW: Dynamische Erstellung von TImage Objekten führt zu Fehler in canvas.inc

  Alt 6. Dez 2012, 22:04
Sehr schön. Danke genau das wollte ich hören

Hab den Code mal weniger TImage missbrauchend gemacht.

Delphi-Quellcode:
procedure DrawEntities(E: Array_Array_TPoint; Source_Bitmap: TBitmap);
var i, t: Integer;
    Destination_Rect, Source_Rect: TRect;
begin
  MAPTEST_form.Image3.Width := 500;
  MAPTEST_form.Image3.Height := 500;
  For i := 0 to Length(E) - 1 do
  begin
    For t := 0 to Length(E[i]) - 1 do
    begin
      Destination_rect := Rect(E[i,t].x*5, E[i,t].y*5, E[i,t].x*5 + 5, E[i,t].y*5 + 5);
      Source_rect := Rect(i * 5, 1, i * 5 + 5, 6);
      MAPTEST_form.Image3.Canvas.FillRect(Destination_rect);
      MAPTEST_form.Image3.Picture.Bitmap.Canvas.CopyRect(Destination_rect,Source_Bitmap.Canvas,Source_rect);
    end;
  end;
end;
  Mit Zitat antworten Zitat