mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-08 03:17:19 +01:00
Graphics: Fix TPicture.LoadFromStream not detecting ico and cur graphics. Issue #41872.
This commit is contained in:
parent
26fdc1786d
commit
3d86f3b9cf
@ -1638,6 +1638,7 @@ type
|
||||
function InternalReleaseBitmapHandle: HBITMAP; override;
|
||||
function InternalReleaseMaskHandle: HBITMAP; override;
|
||||
function InternalReleasePalette: HPALETTE; override;
|
||||
class function IsStreamFormatSupported(Stream: TStream): Boolean; override;
|
||||
procedure ReadData(Stream: TStream); override;
|
||||
procedure ReadStream(AStream: TMemoryStream; ASize: Longint); override;
|
||||
procedure SetMasked(AValue: Boolean); override;
|
||||
|
||||
@ -665,6 +665,17 @@ begin
|
||||
else Result := TIconImage(TSharedIcon(FSharedImage).FImages[FCurrent]).ReleasePalette;
|
||||
end;
|
||||
|
||||
class function TCustomIcon.IsStreamFormatSupported(Stream: TStream): Boolean;
|
||||
var
|
||||
Signature: array[0..3] of Byte;
|
||||
Position: UInt64;
|
||||
begin
|
||||
Position := Stream.Position;
|
||||
Stream.Read(Signature, SizeOf(Signature));
|
||||
Stream.Position := Position;
|
||||
Result := (Cardinal(Signature) = GetStreamSignature);
|
||||
end;
|
||||
|
||||
function TCustomIcon.LazarusResourceTypeValid(const ResourceType: string): boolean;
|
||||
var
|
||||
ResType: String;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user