Jump to content

Incus J

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. Thank you for all the responses. It makes sense that FMX might have its own queue for UI controls. So Application.ProcessMessages may not be viable, and there may be a much better way to solve this, somehow. If I get a little more specific, would that help point to an alternative approach? Here's what I have so far: 1. User clicks "Go" 2. UI is disabled 3. Lots of photos are processed (lengthy operation) 4. UI is enabled again Apart from a Cancel button, the UI is intentionally disabled to user input during the lengthy operation. However several UI controls are regularly updated to indicate progress (a progress bar, image list, image view). This is all working OK right now. Since the UI is disabled, re-entrancy isn't an issue. The only thing lacking is a way to let the user cancel the lengthy operation part way through if they wish. I'd like to keep it simple. Is there a simple robust way to achieve a Cancel button? Threads: This scares me. Everything I've read on Delphi tasks and threads in forum post suggests they can lead to really hard to find program failures, and the library perhaps not yet robust. I've developed commercial software in Delphi for 20 years, but I don't feel ready for threads (or maybe the threading library isn't ready for me?). At the moment my software is working. Is there a safe, reliable approach to creating a Cancel button that doesn't give me the option to shoot myself, or my users, in the foot?
  2. In Delphi VCL I can use application.processmessages to process any queued messages, including pending events such as mouse clicks. Firemonkey also has application.processmessages - but its behaviour seems different, in that it doesn't process queued mouse clicks on buttons. This means that I am unable to check to see whether a Cancel button has been clicked part way through an operation. Is this correct? (Delphi FMX Tokyo 10.2.3)
  3. I'm having difficulty saving a JPEG file in Firemonkey. Here's the code: procedure SaveImage(bmp:TBitmap; filename:string); var vOpt:TBitmapCodecSaveParams; begin vOpt.Quality:=20; //Quality setting ignored? :( bmp.SaveToFile(filename,@vOpt); end; On Windows everything seems OK, however when the program is compiled for MacOS the resulting JPEG file is not at the Quality specified. The image quality setting seems to be ignored. How do I set the JPEG output quality on MacOS? (Delphi Tokyo 10.2.3)
×