mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-03 04:20:39 +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
|
protected
|
||||||
procedure FreeHandle; override;
|
procedure FreeHandle; override;
|
||||||
function ReleaseHandle: THandle; virtual;
|
function ReleaseHandle: THandle; virtual;
|
||||||
function IsEmpty: boolean;
|
function IsEmpty: boolean; virtual;
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
procedure CreateDefaultHandle(AWidth, AHeight: Integer; ABPP: Byte); virtual; abstract;
|
procedure CreateDefaultHandle(AWidth, AHeight: Integer; ABPP: Byte); virtual; abstract;
|
||||||
@ -1218,6 +1218,7 @@ type
|
|||||||
procedure FreeImage;
|
procedure FreeImage;
|
||||||
function ReleasePalette: HPALETTE;
|
function ReleasePalette: HPALETTE;
|
||||||
function GetPixelFormat: TPixelFormat;
|
function GetPixelFormat: TPixelFormat;
|
||||||
|
function IsEmpty: boolean; override;
|
||||||
public
|
public
|
||||||
constructor Create; override;
|
constructor Create; override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
constructor TSharedCustomBitmap.Create;
|
constructor TSharedCustomBitmap.Create;
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
FImage.Init;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TSharedCustomBitmap.Destroy;
|
destructor TSharedCustomBitmap.Destroy;
|
||||||
@ -86,6 +87,16 @@ begin
|
|||||||
Result := pfCustom;
|
Result := pfCustom;
|
||||||
end;
|
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;
|
function TSharedCustomBitmap.GetWidth: Integer;
|
||||||
begin
|
begin
|
||||||
if FImage.Description.Format = ricfNone
|
if FImage.Description.Format = ricfNone
|
||||||
|
Loading…
Reference in New Issue
Block a user