mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 13:38:07 +02:00
IconFinder: Fix failure to display BMP icons.
This commit is contained in:
parent
a153126d5a
commit
b5e2e98d35
@ -18,8 +18,8 @@ unit IconThumbNails;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fgl, contnrs, FPImage, StrUtils, LazLoggerBase,
|
||||
laz2_dom, laz2_xmlread, laz2_xmlwrite,
|
||||
Classes, SysUtils, fgl, contnrs, FPImage, FPReadBMP, StrUtils, LazLoggerBase,
|
||||
laz2_dom, laz2_xmlread, laz2_xmlwrite, IntfGraphics,
|
||||
FileUtil, LazFileUtils, Graphics, Controls, Dialogs, Menus, Forms,
|
||||
IconFinderStrConsts, BasicThumbnails;
|
||||
|
||||
@ -267,6 +267,8 @@ begin
|
||||
begin
|
||||
x := (Viewer.ThumbnailWidth - pic.Width) div 2;
|
||||
y := (Viewer.ThumbnailHeight - pic.Height) div 2;
|
||||
if Assigned(pic.Bitmap) then
|
||||
pic.Bitmap.Transparent := true;
|
||||
ACanvas.Draw(ARect.Left + x, ARect.Top + y, pic.Bitmap);
|
||||
end;
|
||||
end;
|
||||
@ -1149,6 +1151,11 @@ begin
|
||||
reader := TFPCustomImage.FindReaderFromStream(stream);
|
||||
if reader <> nil then
|
||||
begin
|
||||
{$if FPC_FullVersion < 30301}
|
||||
// Workaround for FPReaderBMP not implementing "ImageSize"
|
||||
if reader = TFPReaderBMP then
|
||||
reader := TLazReaderBMP;
|
||||
{$ifend}
|
||||
stream.Position := 0;
|
||||
with reader.ImageSize(stream) do
|
||||
begin
|
||||
|
@ -5091,6 +5091,7 @@ begin
|
||||
end;
|
||||
|
||||
{$IF FPC_FullVersion < 30301}
|
||||
{ Workaround for TFPReaderBMP not implementing InternalSize in FPC before 3.3.1}
|
||||
class function TLazReaderBMP.InternalSize (Stream: TStream): TPoint;
|
||||
var
|
||||
fileHdr: TBitmapFileHeader;
|
||||
|
Loading…
Reference in New Issue
Block a user