mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 13:19:21 +02:00
lcl: add TGraphic.Clear
git-svn-id: trunk@15507 -
This commit is contained in:
parent
2cc82836ab
commit
278aa5bc29
@ -700,6 +700,7 @@ type
|
|||||||
procedure WriteData(Stream: TStream); virtual; // used by filer
|
procedure WriteData(Stream: TStream); virtual; // used by filer
|
||||||
public
|
public
|
||||||
constructor Create; virtual;
|
constructor Create; virtual;
|
||||||
|
procedure Clear; virtual;
|
||||||
function LazarusResourceTypeValid(const AResourceType: string): boolean; virtual;
|
function LazarusResourceTypeValid(const AResourceType: string): boolean; virtual;
|
||||||
procedure LoadFromFile(const Filename: string); virtual;
|
procedure LoadFromFile(const Filename: string); virtual;
|
||||||
procedure LoadFromStream(Stream: TStream); virtual; abstract;
|
procedure LoadFromStream(Stream: TStream); virtual; abstract;
|
||||||
@ -1165,6 +1166,7 @@ type
|
|||||||
constructor Create; override;
|
constructor Create; override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Assign(Source: TPersistent); override;
|
procedure Assign(Source: TPersistent); override;
|
||||||
|
procedure Clear; override;
|
||||||
procedure FreeImage;
|
procedure FreeImage;
|
||||||
function BitmapHandleAllocated: boolean; virtual; abstract;
|
function BitmapHandleAllocated: boolean; virtual; abstract;
|
||||||
function MaskHandleAllocated: boolean; virtual; abstract;
|
function MaskHandleAllocated: boolean; virtual; abstract;
|
||||||
@ -1469,6 +1471,7 @@ type
|
|||||||
|
|
||||||
procedure Add(AFormat: TPixelFormat; AHeight, AWidth: Word);
|
procedure Add(AFormat: TPixelFormat; AHeight, AWidth: Word);
|
||||||
procedure Assign(Source: TPersistent); override;
|
procedure Assign(Source: TPersistent); override;
|
||||||
|
procedure Clear; override;
|
||||||
procedure Delete(Aindex: Integer);
|
procedure Delete(Aindex: Integer);
|
||||||
procedure Remove(AFormat: TPixelFormat; AHeight, AWidth: Word);
|
procedure Remove(AFormat: TPixelFormat; AHeight, AWidth: Word);
|
||||||
procedure GetDescription(Aindex: Integer; out AFormat: TPixelFormat; out AHeight, AWidth: Word);
|
procedure GetDescription(Aindex: Integer; out AFormat: TPixelFormat; out AHeight, AWidth: Word);
|
||||||
|
@ -21,6 +21,11 @@ begin
|
|||||||
Inherited Create;
|
Inherited Create;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TGraphic.Clear;
|
||||||
|
begin
|
||||||
|
Assign(nil);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TGraphic.DefineProperties(Filer: TFiler);
|
procedure TGraphic.DefineProperties(Filer: TFiler);
|
||||||
|
|
||||||
function DoWrite: Boolean;
|
function DoWrite: Boolean;
|
||||||
|
@ -252,9 +252,16 @@ procedure TCustomIcon.Assign(Source: TPersistent);
|
|||||||
begin
|
begin
|
||||||
if Source is TCustomIcon then
|
if Source is TCustomIcon then
|
||||||
FCurrent := TCustomIcon(Source).Current;
|
FCurrent := TCustomIcon(Source).Current;
|
||||||
|
|
||||||
inherited Assign(Source);
|
inherited Assign(Source);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomIcon.Clear;
|
||||||
|
begin
|
||||||
|
FreeSaveStream;
|
||||||
|
FCurrent := -1;
|
||||||
|
end;
|
||||||
|
|
||||||
function TCustomIcon.BitmapHandleAllocated: boolean;
|
function TCustomIcon.BitmapHandleAllocated: boolean;
|
||||||
begin
|
begin
|
||||||
Result := (FCurrent <> -1) and (TIconImage(TSharedIcon(FSharedImage).FImages[FCurrent]).FHandle <> 0);
|
Result := (FCurrent <> -1) and (TIconImage(TSharedIcon(FSharedImage).FImages[FCurrent]).FHandle <> 0);
|
||||||
|
@ -88,8 +88,7 @@ begin
|
|||||||
|
|
||||||
if Source = nil
|
if Source = nil
|
||||||
then begin
|
then begin
|
||||||
FreeSaveStream;
|
Clear;
|
||||||
SetSize(0, 0);
|
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -97,6 +96,12 @@ begin
|
|||||||
inherited Assign(Source);
|
inherited Assign(Source);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TRasterImage.Clear;
|
||||||
|
begin
|
||||||
|
FreeSaveStream;
|
||||||
|
SetSize(0, 0);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TRasterImage.BitmapHandleNeeded;
|
procedure TRasterImage.BitmapHandleNeeded;
|
||||||
const
|
const
|
||||||
BITCOUNT_MAP: array[TPixelFormat] of Byte = (
|
BITCOUNT_MAP: array[TPixelFormat] of Byte = (
|
||||||
|
Loading…
Reference in New Issue
Block a user