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