mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-08 18:19:24 +01:00
lcl:
- 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:
parent
8c0aae4a24
commit
8519c89579
@ -6,7 +6,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||||
IntfGraphics, GraphType, FPImage, LCLType, ExtCtrls, ComCtrls;
|
IntfGraphics, GraphType, FPImage, LCLType, ExtCtrls, ComCtrls, FileUtil;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ TForm1 }
|
{ TForm1 }
|
||||||
|
|||||||
@ -1329,7 +1329,6 @@ type
|
|||||||
protected
|
protected
|
||||||
procedure InitializeReader(AImage: TLazIntfImage; AReader: TFPCustomImageReader); override;
|
procedure InitializeReader(AImage: TLazIntfImage; AReader: TFPCustomImageReader); override;
|
||||||
procedure InitializeWriter(AImage: TLazIntfImage; AWriter: TFPCustomImageWriter); override;
|
procedure InitializeWriter(AImage: TLazIntfImage; AWriter: TFPCustomImageWriter); override;
|
||||||
procedure FinalizeReader(AReader: TFPCustomImageReader); override;
|
|
||||||
class function GetReaderClass: TFPCustomImageReaderClass; override;
|
class function GetReaderClass: TFPCustomImageReaderClass; override;
|
||||||
class function GetWriterClass: TFPCustomImageWriterClass; override;
|
class function GetWriterClass: TFPCustomImageWriterClass; override;
|
||||||
class function GetSharedImageClass: TSharedRasterImageClass; override;
|
class function GetSharedImageClass: TSharedRasterImageClass; override;
|
||||||
|
|||||||
@ -34,14 +34,6 @@ end;
|
|||||||
|
|
||||||
{ TBitmap }
|
{ 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;
|
class function TBitmap.GetFileExtensions: string;
|
||||||
begin
|
begin
|
||||||
Result:='bmp';
|
Result:='bmp';
|
||||||
|
|||||||
@ -131,11 +131,12 @@ begin
|
|||||||
// move mask to image data, so we only have to create one handle
|
// move mask to image data, so we only have to create one handle
|
||||||
// (and don't have to think about imahehandle format)
|
// (and don't have to think about imahehandle format)
|
||||||
|
|
||||||
|
MaskImage.Init;
|
||||||
MaskImage.Description := ImagePtr^.Description.GetDescriptionFromMask;
|
MaskImage.Description := ImagePtr^.Description.GetDescriptionFromMask;
|
||||||
MaskImage.DataSize := ImagePtr^.MaskSize;
|
MaskImage.DataSize := ImagePtr^.MaskSize;
|
||||||
MaskImage.Data := ImagePtr^.Mask;
|
MaskImage.Data := ImagePtr^.Mask;
|
||||||
|
|
||||||
if RawImage_CreateBitmaps(MaskImage, msk, dummy, False)
|
if CreateCompatibleBitmaps(MaskImage, msk, dummy, True)
|
||||||
then begin
|
then begin
|
||||||
if BitmapHandleAllocated
|
if BitmapHandleAllocated
|
||||||
then UpdateHandles(BitmapHandle, msk)
|
then UpdateHandles(BitmapHandle, msk)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user