- fix TCustomBitmap.MaskHandleNeeded. It used non-compatible description to create mask handle (#0011850)
  - fix TBitmap. Don't set FTransparentColor - it must be clDefault
examples:
  - fix compilation of icon example

git-svn-id: trunk@16268 -
This commit is contained in:
paul 2008-08-27 09:24:00 +00:00
parent 8c0aae4a24
commit 8519c89579
4 changed files with 3 additions and 11 deletions

View File

@ -6,7 +6,7 @@ interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
IntfGraphics, GraphType, FPImage, LCLType, ExtCtrls, ComCtrls;
IntfGraphics, GraphType, FPImage, LCLType, ExtCtrls, ComCtrls, FileUtil;
type
{ TForm1 }

View File

@ -1329,7 +1329,6 @@ type
protected
procedure InitializeReader(AImage: TLazIntfImage; AReader: TFPCustomImageReader); override;
procedure InitializeWriter(AImage: TLazIntfImage; AWriter: TFPCustomImageWriter); override;
procedure FinalizeReader(AReader: TFPCustomImageReader); override;
class function GetReaderClass: TFPCustomImageReaderClass; override;
class function GetWriterClass: TFPCustomImageWriterClass; override;
class function GetSharedImageClass: TSharedRasterImageClass; override;

View File

@ -34,14 +34,6 @@ end;
{ TBitmap }
procedure TBitmap.FinalizeReader(AReader: TFPCustomImageReader);
begin
if TLazReaderBMP(AReader).MaskMode = lrmmAuto
then FTransparentColor := FPColorToTColor(TLazReaderBMP(AReader).MaskColor);
inherited FinalizeReader(AReader);
end;
class function TBitmap.GetFileExtensions: string;
begin
Result:='bmp';

View File

@ -131,11 +131,12 @@ begin
// move mask to image data, so we only have to create one handle
// (and don't have to think about imahehandle format)
MaskImage.Init;
MaskImage.Description := ImagePtr^.Description.GetDescriptionFromMask;
MaskImage.DataSize := ImagePtr^.MaskSize;
MaskImage.Data := ImagePtr^.Mask;
if RawImage_CreateBitmaps(MaskImage, msk, dummy, False)
if CreateCompatibleBitmaps(MaskImage, msk, dummy, True)
then begin
if BitmapHandleAllocated
then UpdateHandles(BitmapHandle, msk)