Merge pull request #90 from micha137/fmxgraphics-only-from-xe5

Fix compilation of the FMX package with Delphis older than XE5
This commit is contained in:
Laentir Valetov 2017-09-15 22:18:16 +04:00 committed by GitHub
commit 404651d945
2 changed files with 11 additions and 2 deletions

View File

@ -193,7 +193,9 @@ begin
if Assigned(OnBeforePaint) then
OnBeforePaint(Self, FImage);
{$IFDEF DELPHIXE5_UP}
IPLImageToFMXBitmap(FImage.IpImage, BackBuffer);
{$IFEND}
Canvas.DrawBitmap(BackBuffer, RectF(0, 0, BackBuffer.Width, BackBuffer.Height), PaintRect, 1, True);
if Assigned(OnAfterPaint) then

View File

@ -3,15 +3,21 @@ unit ocv.fmxutils;
interface
Uses
ocv.core.types_c,
FMX.Graphics;
ocv.core.types_c
{$IFDEF DELPHIXE5_UP}
, FMX.Graphics
{$IFEND}
;
{$IFDEF DELPHIXE5_UP}
procedure IPLImageToFMXBitmap(const IpImage: pIplImage; const FMXBitmap: TBitmap); inline;
{$IFEND}
implementation
Uses FMX.Types;
{$IFDEF DELPHIXE5_UP}
procedure IPLImageToFMXBitmap(const IpImage: pIplImage; const FMXBitmap: TBitmap); inline;
Var
BitmapData: TBitmapData;
@ -56,5 +62,6 @@ begin
FreeMem(SrcData);
end;
end;
{$IFEND}
end.