Jump to content

Steve Maughan

  • Content Count

  • Joined

  • Last visited

Everything posted by Steve Maughan

  1. Steve Maughan

    APPX & ProgramData Folder...

    Thanks! So how do I access the files? I would have assumed Windows would provide the virtual path when I call: SHGetFolderPath(0, CSIDL_COMMON_APPDATA, 0, SHGFP_TYPE_CURRENT, @path[0]) Is this not the case? Steve
  2. Hi, Google Chrome has started to block the downloads of my application (https://www.alignmix.com). We offer a trial download so anyone can try the software and decide if it's for them. We've been doing this since 2015 with no problems. The application is business-to-business application that helps companies design their sales forces territories. It doesn't contain any malware at all. Everything is done with the user's permission. It is quite a large application at 157 Mb. When the user clicks on the download link they will see the download progress in the bottom left hand corner. Once downloaded Google Chrome informs them "AlignMix-2019-Setup.exe may be dangerous, so Chrome has blocked it" (see the screenshot). There is only one option, and that's to "Discard" — it's not a warning, it's the only option for the user. The only way around this is to delve deep into Google Chrome's setting and disable the "protection" feature and then re-download. I can't see many users taking this route — most, if not all, will simply move on and try to find another solution. The "Discard" button take you to this information page: https://support.google.com/chrome/answer/6261569?visit_id=637231503147981989-2256574895&p=ib_download_blocked&hl=en&rd=1 Which then takes you to this page, " learn how to resolve malware or unwanted software issues": https://support.google.com/webmasters/answer/3258249 When I run a "Security Issues Report" there are no security issues on the site — see screenshot. AlignMix conforms to the software guidelines. This is serious. Since 60% of the visitors to our website use Google Chrome this will have a massive impact on our business. It could jeopardize the viability of my business. Is this the start of Google's war against desktop software? Does anyone have an advise? Has anyone come across this before? All help appreciated! Steve
  3. Fascinating! I didn't think code signing certificate providers had a pecking order! Has anyone else had this experience?
  4. Hi Fred, I gave that a try and it didn't work. I can't imagine Google penalize you for storing stuff on their storage solution. Thanks, Steve
  5. Hi Lars, The Softpedia comment is well taken — I'll remove it now. Can I ask which version of Google Chrome you're using? Thank!
  6. The only review I could see was the for Android APK applications. I haven't been able to find a way of submitting this issue — any clues appreciated.
  7. I'm using the Gnostice tools to create a PDF of a map. The user can select options (e.g. paper size) and then sees a preview before clicking OK and the PDF is exported. The time to create the preview can be considerable; maybe 5 seconds for a complex map. As a result I'd like to create the preview in a separate thread. I can do this using a TTask. What I'm not clear about is what to do if the user changes the options while the preview image is being rendered. The "old" image is now obsolete. I need to destroy the TTask and then create a new one. Does anyone have any code examples of this workflow? Thanks, Steve
  8. I posted the small project to GitHub in case it's of interest to others: https://github.com/stevemaughan/Background-Render Steve
  9. Done! I've attached my solution for those interested. Here's a brief explanation: Whenever the color changes I create a render thread derived from TThread The render thread has an ID (GUID string) and a color (or drawing parameters) I record the last created ID When the thread has completed rendering it posts a message The main thread processes the message, checking to see if the ID is the same as the last ID. If it is then it's draw All render threads are then destroyed Works like a charm! What was tripping me up was wanting to rely on a threading library (which I'm not that familiar with). In this case it was much simpler to create my own thread. Thanks everyone — Steve Background-Render-FINISHED.zip
  10. This seems like the most obvious way to tackle the issue. I'll report back on progress. Thanks, Steve
  11. @Primož Gabrijelčič you're the resident threading expert. Any idea how you'd achieve this using OmniThread library? Thanks, Steve
  12. Exactly! I would have thought this is a common problem
  13. Thanks for all the input. It's clearly tough to give advice without a solid example. I've created a simple project that illustrates the problem — see attached. Here's a short video that explains what's going on: https://www.loom.com/share/500d1f2b0f1f4fe4857eb9a18e07b958 Any suggestions for how to stop the GUI freezing when multiple click to the colorlist would be appreciated. I would have thought this is a common problem. Thanks, Steve Background-Render.zip
  14. Thanks Anders — that makes sense. However, I'm concerned about memory leaks. Suppose I'm creating a TBitmap in the task. How would I guarantee: that it won't corrupt the display (overwrite the second task's bitmap); and it'll be destroyed on completion. This may well be a noob type questions as I've had little experience with TTask before. Thanks — Steve
  15. In my mapping application I need to merge different layers together to create the map. Question: how do I merge a bitmap with anti-aliased text with a bitmap showing a multi-colored image? Is there a way to draw the anti-aliased text on a bitmap with the alpha channel enabled and then have the transparency preserved / respected when it is combined with the other bitmap? Here's a simple example that shows the problem (code attached to this message): procedure TForm2.FormPaint(Sender: TObject); var f: TBitmap; b: TBitmap; x, y: integer; xText: string; xWidth, xHeight: integer; begin //-- Size of image xWidth := Form2.Width; xHeight := Form2.Height; //-- Create the background bitmap f := TBitmap.Create; f.PixelFormat := pf32bit; f.SetSize(xWidth, xHeight); f.Canvas.Brush.Color := clFuchsia; f.Canvas.FillRect(f.Canvas.ClipRect); //-- Create the bitmap with the text b := TBitmap.Create; b.PixelFormat := pf32bit; b.Canvas.Brush.Color := clWhite; b.SetSize(xWidth, xHeight); b.Canvas.Font.Size := 32; b.Canvas.Font.Color := clBlack; b.Canvas.Font.Quality := TFontQuality.fqDefault; //-- Draw the text xText := 'Delphi 25th'; x := (b.Width - b.Canvas.TextWidth(xText)) div 2; y := (b.Height - b.Canvas.TextHeight(xText)) div 2; b.Canvas.TextOut(x, y, xText); //-- Transfer the text layer to the background TransparentBlt(f.Canvas.Handle, 0, 0, xWidth, xHeight, b.Canvas.Handle, 0, 0, xWidth, xHeight, clWhite); //-- Transfer to the form's canvas Form2.Canvas.CopyRect(Form2.Canvas.ClipRect, f.Canvas, f.Canvas.ClipRect); b.Free; f.Free; end; This results in the following screen (also attached to this message): https://ibb.co/GVWRZ6Y You can see the ugly white around the text due to the anti-aliasing. Currently I use non anti-aliased text, but that also looks blocky and ugly too. Thanks and Happy Delphi 25th! Steve Anti-Aliased-Text.zip
  16. Steve Maughan

    Combining bitmaps and preserving antialiased text quality...

    Hi Anders - this sound like what I need. Do you know of any code snippets? Thanks, Steve
  17. Steve Maughan

    Combining bitmaps and preserving antialiased text quality...

    Thanks David — this is what is feared. I had hoped it would act like a PNG with transparency at the pixel level. Cheers, Steve
  18. Steve Maughan

    Combining bitmaps and preserving antialiased text quality...

    Hi Vandrovnik — I'm aware of the basics of Difect2D, but how could I merge two Direct2D canvases and preserve the anti-aliasing of the text? If I'm not mistaken this isn't easy using Direct2D (but I'm far from being an expert on this). Thanks again, Steve
  19. Steve Maughan

    Combining bitmaps and preserving antialiased text quality...

    Interesting — how would you accomplish what I'd like to do using Direct2D? Thanks, Steve
  20. Steve Maughan

    Any Known GDI Lockup Issues with Delphi 10.3.2?

    My mapping program is a VCL app that makes extensive use of GDI drawing to draw the map. I've recently upgraded from Delphi 10.2.3 to 10.3.2. The version compiled with Rio will often lock up after being used for 20 minutes. The app becomes unresponsive for about 15 seconds. In that time the CPU utilization is close to zero and the memory usage doesn't change. After the lock-up it will sometimes become fully responsive or in some case will only be responsive for a moment. There are no error message during or after a lockup. The application is compiled as 64 bit and uses about 1.6 Gb of memory while the test machine has 32 Gb i.e. it's not short of memory. What could cause the lockup? My first thoughts is it's something to do with GDI. Has anything changed with GDI in Delphi Rio compared to Delphi Tokyo? Or maybe it's a virus scanner. I use Panda Dome. I'll switch it for something else to see if that's the problem. Or could it be Windows 10 messing with the memory allocation? I've just updated to Windows 1909. I know it's a long shot but any suggestions are welcome. Steve
  21. Steve Maughan

    Any Known GDI Lockup Issues with Delphi 10.3.2?

    I finally got to the bottom of this error. It's a bug in the Parallel Programming Library that ships with 10.3.2 and 10.3.3. Here's what happened... After I downgraded to 10.2.3 I was just pleased that the freezing stopped. I was also concerned that I'd be stuck using 10.2.3 for ever. So this week I upgraded again; this time to 10.3.3 in the hope the bug didn't show up in this version (the bug had initially appeared in 10.3.2). Unfortunately it showed up—I was gutted! I tried replacing the memory manager - that didn't work. I tried checking for resource leaks; there weren't any. I then switched the main rendering routine to use OmniThread instead of the PPL and that corrected the bug. It seems that after being under load, and then left for a while, the PPL's can suspend some threads for a period of up to 1 minute. If the suspended thread is in a "for" loop the program freezes. Eventually the application comes back to life but it happens repeatedly. The bug wasn't present in 10.2.3 but was present in 10.3.2. I'm elated that the bug is gone! Steve
  22. I have quite a large list of 3000 objects stored in a TList<T>. I need to delete about half of them in a time-critical manner i.e. as fast as possible. I don't need to free the objects, just delete them from the list. Two possible approaches come to mind. I could simply iterate through the list and repeatedly call List.Delete(index) for each item I'd like to remove. Another alternative would be to set the item to nil and then call List.Pack at the end. Is there any advantage in the second approach? Any other insights appreciated. Steve
  23. Hi Stefan - is it? I can't see why it would be a bad idea. Any links to enlighten me? Steve