Jump to content

pyscripter

Members
  • Content Count

    920
  • Joined

  • Last visited

  • Days Won

    56

Everything posted by pyscripter

  1. pyscripter

    NumPy + Demo34

    Did you see my answer in Demo34 + NumPy · Issue #287 · pyscripter/python4delphi (github.com)? Did you try what I suggested there?
  2. pyscripter

    TTreeNode leak when VCL styles are active

    The bug is not related to frames.
  3. pyscripter

    TTreeNode leak when VCL styles are active

    @Carlo Barazzetta SVGIconImageList/Demo at master · EtheaDev/SVGIconImageList (github.com) suffers from the same problem.
  4. I am not sure many know that since the Windows Creators update, svg parsing and painting is natively supported and is part of Direct2D. I wanted to test this Windows feature, however, the first obstacle was that the Direct2d headers that come with Delphi are very very old. There are two open tickets in https://quality.embarcadero.com/. Direct2D 1.1 support missing (open since XE7!) Direct2D 1.2 and 1.3 support missing You may want to vote for them, since lack of good Direct2D support (includes DirectWrite) it is a bit of a shame. I then looked at other Direct2D translations and found two that are regularly updated. MfPack DelphiDX12 They both had some issues but that was a good start. It turned out that parsing and painting svg files to Canvas is quite straightforward. Once you establish a renderer (Vcl.Direct2d does this, but it is easy to do it from scratch) you can do everything with two lines of code. fDeviceContext5.CreateSvgDocument(fStream, D2D1SizeF(ClientWidth, ClientHeight), fsvgDocument); fDeviceContext5.DrawSvgDocument(fsvgDocument); You can check whether Svg is supported by: if Supports( rt, ID2D1DeviceContext5, fDeviceContext5) then And it is easy to do things like scaling, opacity, rotation, recoloring etc. The quality and speed appear to be quite good, but there are some limitations, the most important of which I think is the lack of support for the text element. I am attaching the source code of my test project (no dependencies) in case anyone wants to play with it. The Svg scales automatically as you resize the form. Svg.zip
  5. pyscripter

    Import Requests

    P4D supports named parameters as follows: requests.get('http://192.168.1.200/gci-bin/users', auth:=requests.HTTPDigestAuth('admin','admin') Please note the := notation.
  6. pyscripter

    Prevent External DLL from Exiting Application

    Sometimes it helps to trap the SystemExit exception. This would avoid many abnormal application exits. try: """ Add your Python code here""" except SystemExit as e:
  7. pyscripter

    Clearing the Main Module

    There are many ways to achieve what you want: 1. The ExecString has an overloaded form: procedure TPythonEngine.ExecString(const command : AnsiString; locals, globals : PPyObject ); You can pass a new empty dictionary to the locals and globals argument if you do not want to "pollute" the interpreter namespace. 2. You can manually do the clean up as you suggest above. 3. A more advanced way is to use subinterpreters (have a look at TPythonThread.Execute), but this is more error prone.
  8. I can confirm the issue. Could you please open an issue at Issues · pyscripter/python4delphi (github.com) so that we can track the progress in resolving this?
  9. Releases · weolar/miniblink49 (github.com)
  10. pyscripter

    Delphi 64bit compiler RTL speedup

    Off Topic: VTune also appears to be a free download (Fix Performance Bottlenecks with Intel® VTune™ Profiler). Any experience of using it with Delphi?
  11. pyscripter

    Delphi 64bit compiler RTL speedup

    Looks free to me. Free Intel® Software Development Tools End User License Agreements (intel.com) The license if fairly liberal.
  12. See also Import(Py_DebugFlag) fails on MacOS · Issue #27 · Alexey-T/Python-for-Lazarus (github.com)
  13. Could you debug MapDLL in both and try to see whether they differ? I have looked at the code and could not see any significant difference.
  14. But the two are almost identical nowadays and they both import Py_DebugFlag etc. Could you please pinpoint what makes the differences (e.g. by stepping through the code)? That would be very useful. If you do have access to Delphi for the MacOS can you please also try with that?
  15. Ok. There must be something wrong with the dynamic library you are using. P4D has been used without such issues in MacOS. Could you please try to install a different version of python say 3.7 or 3.9 and test with that? Can any other MacOS user shed some light here?
  16. pyscripter

    Delphi, Python and Android

    Android is not supported yet.
  17. In that case what happens of you comment out the importing of all flags?
  18. Strange. Py_DebugFlag should be exported on all platforms. Please uncomment the line with the Import - Import(Py_DebugFlag). Does it work then?
  19. Are you sure you are using the latest version from pyscripter/python4delphi: Free components that wrap up Python into Delphi and Lazarus (FPC) (github.com)?
  20. pyscripter

    Problem with FPC

    The fpc support for custom variants is incomplete. See the fpc section at SupportedPlatforms · pyscripter/python4delphi Wiki (github.com). Does it work if you store MainModule.screenshot() to a variable and then call ExtractPythonObjectFrom like in the previous example?
  21. pyscripter

    Images in High DPI, how?

    IconFontsImageList is an Image list. Font Awesome and Segoe MDL2 Assets font are both image fonts. They contain images that scale nicely. Anyway... Happy holidays to everyone!
  22. pyscripter

    Images in High DPI, how?

    Fonts scale quite nicely. Font Awesome for example and the like are used in high DPI apps. Microsoft suggests the use of Segoe MDL2 Assets font for UWP applications (supports layering, colorization and mirroring).
  23. I am new to MacOS developement. I have added an new Connection Profile which test successfully, the PAServer is running, XCode has the command line tools, When I try to add a new SDK nothing happens. What am I missing? Any help?
×