Bonjour,
J'ai le code suivant :
La carte est bien assemblée mais les couleurs sont horribles :
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 carte := TBitmap.Create; carte.Width := xmax*256; carte.Height := ymax*256; carte.PixelFormat := pf8bit; for i:=x1 to x2 do begin for j:=y1 to y2 do begin if FileExists(nom) then begin png := TPNGObject.Create; png.LoadFromFile(nom); carte.Canvas.CopyRect(Rect(x*256,y*256,x*256)+png.Width,y*256)+png.Height),png.Canvas,Rect(0,0,png.Width,png.Height)); png.Free; end; Inc(y); end; y := 0; Inc(x); end; carte.SaveToFile(ExtractFilePath(Application.ExeName) + 'carte.bmp'); carte.Free;
Voici les propriétés de mon PNG :
Savez-vous comment je peux corriger ce problème ?
Merci,
Mathieu
Partager