Bonjour,
J'utilise "doParallel" pour modifier les couleurs traitées dans un GetLineStart.
Voici les deux routines qui me servent à contrôler et modifier mes couleurs. Quand je sauvegarde mon PNG puis que je vérifie, les modifications n’ont pas été prise en compte.
Mon code étant relativement simple, j'avoue que je ne comprends pas ce qui bloque.
Auriez-vous une idée ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 procedure TForm1.Button1Click(Sender: TObject); begin ProcThreadPool.DoParallel(@CompterPixelsLigne, 0, fPNG.Height - 1, fPNG); fPNG.SaveToFile(FICHIER_DE_COPIE); Image1.Picture.Assign(fPNG); end; procedure TForm1.CompterPixelsLigne(Index: PtrInt; Data: Pointer; Item: TMultiThreadProcItem); var X: DWord; L : PInteger; P: integer; S: string; begin L := Pinteger(TPortableNetworkGraphic(Data).RawImage.GetLineStart(Index)); P := L^; inc(L); For X := 1 to TPortableNetworkGraphic(Data).Width - 1 do begin S := Format('$%.6x', [(L^ and $FFFFFF)]); if NOT AnsiMatchText(S, Refcolors) then L^:= P; P := L^; inc(L); end; end;
Partager