jvcllaz: Fix JvPicClip demo occasionally showing black extracted images on 64-bit.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6979 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-05-30 20:13:30 +00:00
parent a7ced24331
commit 3bc0347094
2 changed files with 4 additions and 6 deletions

View File

@ -1,13 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<Version Value="12"/> <Version Value="11"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<General> <General>
<Flags>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="JvPicClipDemo"/> <Title Value="JvPicClipDemo"/>
<Scaled Value="True"/> <Scaled Value="True"/>
<ResourceType Value="res"/> <ResourceType Value="res"/>

View File

@ -251,12 +251,12 @@ end;
function TJvPicClip.GetGraphicCell(Index: Integer): TBitmap; function TJvPicClip.GetGraphicCell(Index: Integer): TBitmap;
begin begin
CheckIndex(Index); CheckIndex(Index);
AssignBitmapCell(Picture.Graphic, FBitmap, Cols, Rows, Index); if FPicture.Graphic is TBitmap then
if Picture.Graphic is TBitmap then
if FBitmap.PixelFormat <> pfDevice then if FBitmap.PixelFormat <> pfDevice then
FBitmap.PixelFormat := TBitmap(Picture.Graphic).PixelFormat; FBitmap.PixelFormat := TBitmap(Picture.Graphic).PixelFormat;
FBitmap.TransparentColor := FMaskColor or PaletteMask; FBitmap.TransparentColor := FMaskColor or PaletteMask;
FBitmap.Transparent := (FMaskColor <> clNone) and Masked; FBitmap.Transparent := (FMaskColor <> clNone) and Masked;
AssignBitmapCell(Picture.Graphic, FBitmap, Cols, Rows, Index);
Result := FBitmap; Result := FBitmap;
end; end;