Thema: Delphi Bitmap schnell kopieren

Einzelnen Beitrag anzeigen

Benutzerbild von dizzy
dizzy

Registriert seit: 26. Nov 2003
Ort: Lünen
1.932 Beiträge
 
Delphi 7 Enterprise
 
#9

Re: Bitmap schnell kopieren

  Alt 21. Jan 2004, 19:01
Kleiner Auszug aus dieser Seite:
Zitat von seite:
Several times in the various Delphi newsgroups someone suggests that the number of Scanline accesses should be minimized as an optimization technique since considerable overhead is thought to exist with each call. For example, instead of accessing Scanline once per row (as in many of the examples here), with some extra work Scanline can be accessed only twice at the beginning of the loop stepping through the rows. A "pointer" can be incremented using integer arithmetic instead of a Scanline call for each row.
Ist aber englisch. Kurzes Preview: Scanlineaufrufe kann man soweit minimirern, dass nur noch 2 Zugriffe auf Scanline nötig sind. Man gibt sich quasi die letzte Zeile, und weil Bilder (meistens*) "falschrum" im Speicher liegen incrementiert man einfach den Pointer und kommt trotzdem überall dran.
* genau dieses "meistens" ist eigentlich der wunde Punkt. Es kann vorkommen, dass dein Bild auf einmal irgendwann "richtig herum" im Speicher liegt, und dann ist latürnich alles gedreht... Aber auch das kann man glaub ich abprüfen. Codebeispiele sind auch dabei.

Ob das allerdings schneller als BitBlt ist, weiss ich nicht, und wage es auch zu bezweifeln... Aber wissen halt nicht so...


gruss,
dizzy

[edit=Luckie]Quote-Tags gefixt. Mfg, Luckie[/edit]
Fabian K.
INSERT INTO HandVonFreundin SELECT * FROM Himmel
  Mit Zitat antworten Zitat