Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

3 Neutral
  1. f.m

    [bug] Camera + Effects

    Thank you. Here is the stack trace: The exception occurs in the original version of the code. By protecting the UpdatePreview () method with a flag, this exception does not occur.
  2. f.m

    [bug] Camera + Effects

    Hi, This exception occurs in the FMX.Canvas.D2D file on the line 1996 .
  3. f.m

    [bug] Camera + Effects

    Hi, I add some information. I tested your project in the following configuration: - 10.3.2, Windows 10; - I have not removed the comment to any of the Global.. flags in DPR file; - I didn't use FastMM4. I performed two tests: A) Without using TVideoCaptureDevice. I used a timer and some images: The program works. It is possible to change effects, and use effects options without errors. This leads me to believe that the problem is TVideoCaptureDevice: B) Using TVideoCaptureDevice. Generates exception, which is removed if I use the flag ("if FUpdatePreviewExecuting..") in the SampleBufferReady () method. Test procedure: 1) [Play] 2) [Effect] 3) Click on effect 4) Changing effect parameters 5) Repeat from step 3.
  4. f.m

    How to wait for a file compression to finish?

    Using the code in the link below it is possible to observe that during compression or decompression, the file is locked by one of the following processes: 'explorer' (if compression or decompression is started automatically), 'compact' (if compression or decompression is started using the compact.exe command). When the compression or decompression is finished, the process lock ('explorer' or 'compact') is removed. Note: the code is in c#. http://csharphelper.com/blog/2017/01/see-processes-file-locked-c/
  5. f.m

    [bug] Camera + Effects

    procedure TForm1.SampleBufferReady(Sender: TObject; const ATime: TMediaTime); begin if FUpdatePreviewExecuting then Exit; .. end; procedure TForm1.SetEffect(const AFilterName: string); begin if FUpdatePreviewExecuting then Exit; ... end; procedure TForm1.UpdatePreview; begin FUpdatePreviewExecuting := True; try FFilter.ValuesAsBitmap[ 'Input' ] := FRawBitmap; if not FTargetBitmap.IsEmpty then FFilter.ValuesAsBitmap[ 'Target' ] := FTargetBitmap; imgCam.Bitmap := FFilter.ValuesAsBitmap[ 'Output' ]; finally FUpdatePreviewExecuting := False; end; end; SampleBufferReady() is probably synchronized via TThread.Synchronize(). Try to protect UpdatePreview() with a flag.
  6. f.m

    [FireDAC] Query.MergeDataset - how to use?

    To write changes to the database, try this: LQueryDest.CachedUpdates := True; LQueryDest.MergeDataSet( LQuerySource, TFDMergeDataMode.dmDeltaMerge ); LQueryDest.Connection.StartTransaction(); Assert( 0 = LQueryDest.ApplyUpdates() ); LQueryDest.Connection.Commit(); LQueryDest.CommitUpdates(); LQueryDest.CachedUpdates := False; A record will be saved if its UpdateStatus is Inserted or Modified.
  7. f.m


    TFlowLayout is for FMX, while TFlowPanel is for VCL. At design time, it is possible to change (quite) the position using menu item Control|Bring to front/Send to back. Or, expose the control's index property: uses System.Classes, FMX.StdCtrls; type TButtonIndex = class (TButton) published property Index; end; procedure Register; implementation procedure Register; begin {System.Classes}RegisterComponents('With index', [TButtonIndex]); end; Or, use LiveBinding to bind the control's index property. I've never used LiveBinding and can't show an example.
  8. f.m

    ZXing Delphi not function in 10.3.2

    Hi, I tested the demo at https://github.com/Spelt/ZXing.Delphi/blob/v_3.0/demo/advancedTestApp/main.pas To make it work, I had to apply the following changes // 1) Moved this code from FormCreate to FormActivate {$IFDEF ANDROID} FPermissionCamera := JStringToString(TJManifest_permission.JavaClass.CAMERA); {$ENDIF} PermissionsService.RequestPermissions([FPermissionCamera], AccessCameraPermissionRequestResult, DisplayRationale); // 2) Commented this code in FormCreate, because it is called before the CAMERA permission has been granted. Moved in AccessCameraPermissionRequestResult(). UpdateCaptureSettings(TCameraKind.BackCamera); // 3) Changed AutoFocus to ContinuousAutoFocus. CameraComponent1.FocusMode := TFocusMode.ContinuousAutoFocus; // 4) Modified the SampleBufferReady event: procedure TForm1.CameraComponent1SampleBufferReady(Sender: TObject; const ATime: TMediaTime); begin // TThread.Synchronize(TThread.CurrentThread, SyncBitmap); // ParseBitmap(); TThread.Queue(nil, procedure () begin SyncBitmap(); ParseBitmap(); end); end; Also, changed TBarcodeFormat.Auto to TBarcodeFormat.QR_CODE.
  9. f.m


    Hi, Try this: procedure TForm1.FormCreate(Sender: TObject); var LIndex: Integer; LRect : TRectangle; LText : TText; begin for LIndex := 0 to 10-1 do begin LRect := TRectangle.Create( FlowLayout1 ); LRect.Parent := FlowLayout1; LRect.Fill.Color := TAlphaColor($FF000000 or Random($00FFFFFF)); LText := TText.Create( LRect ); LText.Parent := LRect; LText.Align := TAlignLayout.Contents; LText.Text := IntToStr( LIndex ); LText.TextSettings.FontColor := TAlphaColors.White; LText.HitTest := False; end; end; procedure TForm1.ButtonSwap5_6Click(Sender: TObject); var LRect : TRectangle; begin FlowLayout1.BeginUpdate(); LRect := FlowLayout1.Controls[6] as TRectangle; FlowLayout1.Controls.Remove( LRect ); FlowLayout1.Controls.Insert( 5, LRect ); FlowLayout1.EndUpdate(); end;
  10. f.m

    Firedac option MergeDataMode incomprehensibility

    TFDMergeDataMode.dmDeltaMerge mantains source record UpdateStatus: Source Record UpdateStatus Primary key exists ? Dest Record UpdateStatus usInserted No usInserted usInserted Yes usModified After MergeDataSet(dmDeltaMerge), UpdatesPending is true, so it is possible to use ApplyUpdates(). TFDMergeDataMode.dmDataMerge changes UpdateStatus to usUnmodified: Source Record UpdateStatus Primary key exists ? Dest Record UpdateStatus usInserted No usUnmodified usInserted Yes usUnmodified After MergeDataSet(dmDataMerge), UpdatesPending is false.
  11. f.m

    TEdit with a background color

    Hi, Try Result.Locked := True;