Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCL/Graphics    [ Add a report in this area ]  
Report #:  101632   Status: Open
TPNGImage draws itself slightly incorrectly
Project:  Delphi Build #:  XE2
Version:    16.2 Submitted By:   Dmitry Kozhinov
Report Type:  Minor failure / Design problem Date Reported:  12/7/2011 10:42:32 AM
Severity:    Infrequently encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All versions Internal Tracking #:   289092
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
For some (not all) indexed PNG images, TPNGImage object draws itself on a form canvas with slightly shifted color values.

This may be important when using TransparentColorValue property of a form - not getting tranparency where expected.
Steps to Reproduce:
1) Use png_indexed2.png file (download from http://www.desktopfay.com/temp/png_indexed2.png). It is filled with RGB(10, 59, 118) color.

2) OnPaint event handler of a form:

var
  aPNGImage : TPNGImage;
begin
  aPNGImage:=TPNGImage.Create;
  aPNGImage.LoadFromFile('C:\temp\png_indexed2.png');
  TransparentColorValue:=RGB(10, 59, 118); {not getting transparent area}
  {TransparentColorValue:=RGB(10, 58, 117); uncomment this to get transparent area}
  Canvas.Draw(0, 0, aPNGImage);
  aPNGImage.Free;
end;
Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01