![]() |
PNG im IE(7) nicht darstellbar
Liste der Anhänge anzeigen (Anzahl: 1)
Ich erzeuge PNG's (PNG-Lib von LMD - Basiert auf PNGImage von Gustavo), welche jedoch im IE nicht dargestellt werden können.
Mein Code ist zur Erstellung der Transparenz ist:
Delphi-Quellcode:
Hat jemand eine Ahnung was dem PNG für den IE fehlt?
PngObj.RemoveTransparency;
PngObj.CreateAlpha; RValue := GetRValue(TransColor); GValue := GetGValue(TransColor); BValue := GetBValue(TransColor); for y := 0 to PngObj.Height-1 do begin ScanLine := PngObj.Scanline[y]; ScanlineAlpha := PngObj.AlphaScanline[y]; if Assigned(ScanlineAlpha) then begin for x := 0 to PngObj.Width-1 do begin //RGB-Wert des Pixels stimmt mit Transparenzfarbe überein if (ScanLine^.rgbtRed = RValue) and (ScanLine^.rgbtGreen = GValue) and (ScanLine^.rgbtBlue = BValue) then begin ScanlineAlpha^[x] := 0; end; Inc(Scanline); end; end; end; |
Re: PNG im IE(7) nicht darstellbar
Gelöst. Fehler im Quellcode der Methode .RemoveTransparency
Fix:
Delphi-Quellcode:
...
case ColorType of {Palette uses the TLMDPNGChunktRNS to store alpha} COLOR_PALETTE, COLOR_RGB, COLOR_GRAYSCALE: begin TRNS := Chunks.ItemFromClass(TLMDPNGChunkTRNS) as TLMDPNGChunkTRNS; if TRNS <> nil then Chunks.RemoveChunk(TRNS) end; ... |
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:58 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz