mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-18 20:29:33 +02:00
lcl: TSharedCustomBitmap IsEmpty should differ from TRasterImage. TRasterImage only checks stream and handle, but TSharedCustomBitmap also has an image which can contain data and thus must be checked too. fixes #0011222
git-svn-id: trunk@15578 -
This commit is contained in:
parent
beff60f884
commit
5e85db3260
@ -1081,7 +1081,7 @@ type
|
||||
protected
|
||||
procedure FreeHandle; override;
|
||||
function ReleaseHandle: THandle; virtual;
|
||||
function IsEmpty: boolean;
|
||||
function IsEmpty: boolean; virtual;
|
||||
public
|
||||
constructor Create; virtual;
|
||||
procedure CreateDefaultHandle(AWidth, AHeight: Integer; ABPP: Byte); virtual; abstract;
|
||||
@ -1218,6 +1218,7 @@ type
|
||||
procedure FreeImage;
|
||||
function ReleasePalette: HPALETTE;
|
||||
function GetPixelFormat: TPixelFormat;
|
||||
function IsEmpty: boolean; override;
|
||||
public
|
||||
constructor Create; override;
|
||||
destructor Destroy; override;
|
||||
|
@ -19,6 +19,7 @@
|
||||
constructor TSharedCustomBitmap.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
FImage.Init;
|
||||
end;
|
||||
|
||||
destructor TSharedCustomBitmap.Destroy;
|
||||
@ -86,6 +87,16 @@ begin
|
||||
Result := pfCustom;
|
||||
end;
|
||||
|
||||
function TSharedCustomBitmap.IsEmpty: boolean;
|
||||
begin
|
||||
Result := inherited IsEmpty and not
|
||||
(
|
||||
(FImage.Description.Format <> ricfNone) and
|
||||
(FImage.Data <> nil) and
|
||||
(FImage.DataSize <> 0)
|
||||
);
|
||||
end;
|
||||
|
||||
function TSharedCustomBitmap.GetWidth: Integer;
|
||||
begin
|
||||
if FImage.Description.Format = ricfNone
|
||||
|
Loading…
Reference in New Issue
Block a user