-
Content Count
780 -
Joined
-
Last visited
-
Days Won
42
Everything posted by pyscripter
-
Running the stand-alone grep reports: "Failed to load any of the possible GExpert.dlls"
-
Help: preview of Svg image in Open-Dialog works only with VCLStyle active.
pyscripter replied to Carlo Barazzetta's topic in VCL
It should be mentioned that one of the package units registers the new file format: initialization TPicture.RegisterFileFormat('SVG', 'Scalable Vector Graphics', TSVGGraphic); Use PowerToys to get SVG preview at run time when you disable Vcl styles. (Also in File Explorer) -
10.4.1 Released today
pyscripter replied to Darian Miller's topic in Tips / Blogs / Tutorials / Videos
Wow! And a fix for Threading - Incorrect calculation of IdleWorkerThreadCount. See https://en.delphipraxis.net/topic/2428-threads-in-ppl-thread-pool-not-returning-to-idle-as-expected/ -
10.4.1 Released today
pyscripter replied to Darian Miller's topic in Tips / Blogs / Tutorials / Videos
The fix to TMonitor discussed in is in. -
... of TXMLDocument. Fully agree. MSXML contains a SAX reader/writer. Delphi implementation examples at http://www.craigmurphy.com/bug/. XMLLite is a good alternative to SAX on Windows. See the note about push and pull parsers. Similar speed and much easier to program with. And there is a Delphi wrapper (just a single unit to add to your project).
-
OmniXML is included in Delphi, but I am not sure how it compares to the standalone one. If you look at the benchmarks of OXml you will see that if you access the library through Delphi XML and the OXml vendor you would consume almost 10 times more memory and 5.7 times more CPU time compared to raw access. The navigation time increases 32 times!! Which is exactly the point I was trying to make.
-
Where exactly do we disagree? I started by saying the features are great. But if xml processing is a performance bottleneck you can improve performance drastically (see below) by accessing the underlying implementation directly with minimal changes to your code, since implementations follow the standard DOM interfaces.
-
imagelist Looking for Icon Fonts support in Delphi for High-DPI and Themed app?
pyscripter replied to Carlo Barazzetta's topic in VCL
Indeed: From https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-addfontmemresourceex -
dic.Items['aaa']:=l2; dic.Items['aaa'] already contains l2 and l2 is freed before it is readded, since you set doOwnsValues Also an issue would occur if you do dic.Items['bbb']:=l2; When the dictionary is destroyed the list will be freed twice.
-
See https://github.com/akramhussein/Mute
-
Generic circular buffer library released
pyscripter replied to TurboMagic's topic in Algorithms, Data Structures and Class Design
Has this been released? Is that the develop branch? -
PyScripter reached 1 million downloads from Sourceforge
pyscripter replied to pyscripter's topic in I made this
True, but it is kind of hard to keep track of them (count, geographic distribution etc.). -
August 2020 GM Blog post
pyscripter replied to Darian Miller's topic in Tips / Blogs / Tutorials / Videos
It refers to the intention to promote Python4Delphi as a means of bringing Python and Delphi closer together: Python for Delphi (P4D) is a set of free components that wrap up the Python dll into Delphi and Lazarus (FPC). They let you easily execute Python scripts, create new Python modules and new Python types. You can create Python extensions as dlls and much more. P4D provides different levels of functionality: Low-level access to the python API High-level bi-directional interaction with Python Access to Python objects using Delphi custom variants (VarPyth.pas) Wrapping of Delphi objects for use in python scripts using RTTI (WrapDelphi.pas) Creating python extension modules with Delphi classes and functions P4D makes it very easy to use python as a scripting language for Delphi applications. It comes with an extensive range of demos and tutorials. -
High-level interface-based encapsulation of Direct2D Svg functionality
pyscripter posted a topic in Windows API
In the attachment you can find a high-level interface-based encapsulation of the Direct2D SVG functionality. It allows you to parse SVG files and draw them to a GDI/GDI+ DC. Requires Windows 10 with Creators Update or later. Main form code to display SVG files: { TForm1 } procedure TForm1.FormCreate(Sender: TObject); begin fSVG := GetD2DSVGHandler.NewSvg; fSVG.LoadFromFile('..\..\browser.svg'); //fSVG.FixedColor := TAlphaColorRec.Red; //fSVG.Opacity := 0.5; fSVG.GrayScale := True; end; procedure TForm1.Paint; begin inherited; fSvg.PaintTo(Canvas.Handle, TRectF.Create(ClientRect), True); end; procedure TForm1.Resize; begin inherited; Invalidate; end; Features: Scale to any size Keep aspect ratio (optionally) Control opacity Recolor to any color Draw in gray scale Samples: The above in grayscale: Svg.zip -
Java terminology... https://www.programcreek.com/2011/12/monitors-java-synchronization-mechanism/
-
High-level interface-based encapsulation of Direct2D Svg functionality
pyscripter replied to pyscripter's topic in Windows API
@Attila KovacsThanks. Just replace D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT with $00000004. And of course both LPCWSTR and LPWSTR are cast to PWideChar. But you are right! I would like to add that the purpose of Winapi.D2DMissing is not to provide for the missing D2D API, but to include just enough to serve the purpose of handling svg files. Warning: there are many translation errors in the the parts not used in this project. "TOSVersion.Build returns 0 on my system". Any idea why? Is this a Delphi bug? A more reliable way would be: if Supports(RenderTarget, ID2D1DeviceContext5) then //Supported But that would involve creating the Factory and the Render Target. Any other suggestions? -
High-level interface-based encapsulation of Direct2D Svg functionality
pyscripter replied to pyscripter's topic in Windows API
The attached fixes both issues. Svg.zip -
High-level interface-based encapsulation of Direct2D Svg functionality
pyscripter replied to pyscripter's topic in Windows API
Thanks. The aim is to integrate it with https://github.com/EtheaDev/SVGIconImageList -
Is there a way to check whether the Windows version is 10 with the Creators Update or later installed, using the RTL? I know that Jcl provides support for that.
-
In Jcl there is something called Windows10ReleaseId (1703 for Creators Update). Is this same as the build number? (I think not)
-
If you do it on the Root it works as expected.
-
@Mahdi Safsafi You are my hero!
-
@Attila Kovacs RecolorSubtree(Root, D2D1ColorF(0.5, 80, 80, 80)); does not make sense The Values need to be between 0 and 1 for instance. D2D1ColorF(clRed) = D2D1ColorF(1,0,0,1) I will doing drawing in GrayScale. Does anyone know how to draw the svg with opacity say 0.5? Everything not just the fill color possibly using D2D primitives?
-
@Kas Ob.order which is the same as shown by IDA works here. I can recolor both ways: if Succeeded(Element.GetAttributeValue('fill', D2D1_SVG_ATTRIBUTE_POD_TYPE_COLOR, @OldColor, SizeOf(OldColor))) then begin if (OldColor.r <> 0) or (OldColor.g <> 0) or (OldColor.b <> 0) then Assert(Succeeded(Element.SetAttributeValue('fill', D2D1_SVG_ATTRIBUTE_POD_TYPE_COLOR, @NewColor, SizeOf(NewColor)))); end; and Assert(Succeeded(Element.GetAttributeValue('fill', IID_ID2D1SvgPaint, Pointer(Paint)))); if Assigned(Paint) then begin Paint._AddRef; if Paint.GetPaintType = D2D1_SVG_PAINT_TYPE_COLOR then begin Paint.GetColor(OldColor); if (OldColor.r <> 0) or (OldColor.g <> 0) or (OldColor.b <> 0) then Paint.SetColor(NewColor); end; end; end; The declaration of SetColor needs to be changed: function SetColor(Const color: D2D1_COLOR_F): HResult; stdcall;