Ich habe mir eine Minimap gebastelt
anzeigen mache ich so:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
| procedure TForm1.drawmap(plchange:boolean); Const sourcew:Integer=3577; sourceh:Integer=994; begin if(mapx<0) then mapx:=0; if(mapy<0) then mapy:=0; if(mapx+Destw>sourcew) then mapx:=sourcew-Destw; if(mapy+Desth>sourceh) then mapy:=sourceh-Desth; imgMap.Canvas.CopyRect(Rect(Destl,Destt,Destl+Destw,Destt+Desth),Pic.Bitmap.Canvas,Rect(mapx,mapy,mapx+Destw,mapy+Desth)); end; |
imgMap ist eine TImage Komponente auf dem form
Pic ist ein TPicture mit nem Bild von sourcew x sourceh als Größe
mapx,mapy ist die position auf diesem bild
und die Dest variablen die ausmaße und position auf dem ziel
diese map kann ich mit der maus verschieben
Problem: es flackert recht hässlich
kann ich da was machen?
(hab schon prüfungen drin ob bewegt wurde oder nicht)
EDIT: hab jetzt autosize auf true gesetzt...flakert nicht mehr...seltsam