

hsauro
-
Content Count
104 -
Joined
-
Last visited
-
Days Won
2
Posts posted by hsauro
-
-
Any progress made on this? It looks like it's still not possible to handle the Mouse events.
-
I've been trying to figure out how I can allow a user to select a block of cells in a FMX TStringGrid with a mouse drag operation. If one creates a FMX TStringGrid and adds columns, it only lets you select one cell at a time.
The VCL TStringGrid has a goRangeSelection option but I can't find any options to select multiple cells in the FMX TStringGrid. Any suggestions? Also if multiple cells can be selected how does one determine which block of cells were selected?
-
If you’ve done any 2d drawing with VCL it’s not too dissimilar to that. If you need interactive drawing, use a TPaintBox component and write your drawing code in the onpaint event. This control can also detect mouse actions so that you can respond to events like mousedown, mouse up and mouse move.
https://stackoverflow.com/questions/40677671/how-to-draw-a-line-in-delphi-on-an-fmx-canvas
-
1
-
-
Thanks for the example, I think this will be useful to others as well.
-
All I actually want is to draw text that is orientated 90 degrees to the horizontally, ie vertical. No fancy paths to follow, just a straight line. I can currently do it by rotating the image first by 90 degress, writing the text horizontally, then rotate the image back -90 degrees.
-
7 minutes ago, hsauro said:I’m trying to display rotated text using skiaDelphi but it appears that the recommended skia way is to rotate the underlying image, write your text, then rotate the image back again. That can work but it requires some thought with respect to coordinates.
some users from the c# community suggested using a path as in
using (SKPaint skPaint = new SKPaint()) { SKPath path = new SKPath(); path.MoveTo(original.Width / 10, original.Height - original.Height / 10); path.LineTo(original.Width - original.Width / 10, original.Height / 10); canvas.DrawTextOnPath(textToWrite, path, 0, 0, skPaint); path.Dispose() }
but I don’t see the method drawtextonpath in the skia4delphi library.
I found this
https://github.com/mono/SkiaSharp/issues/1183
looks like Google removed that functionality. Guess it’s rotate image, draw, rotate image back.
-
I’m trying to display rotated text using skiaDelphi but it appears that the recommended skia way is to rotate the underlying image, write your text, then rotate the image back again. That can work but it requires some thought with respect to coordinates.
some users from the c# community suggested using a path as in
using (SKPaint skPaint = new SKPaint()) { SKPath path = new SKPath(); path.MoveTo(original.Width / 10, original.Height - original.Height / 10); path.LineTo(original.Width - original.Width / 10, original.Height / 10); canvas.DrawTextOnPath(textToWrite, path, 0, 0, skPaint); path.Dispose() }
but I don’t see the method drawtextonpath in the skia4delphi library.
-
Someone asked that I include the timings in the code and while I was at it I folded in the code provided by contributors here. I'll probably add TImage32 at some point as well.
https://github.com/hsauro/Mandelbrot
There is a new binary release on Github,
-
1
-
-
To answer my own question, submissions can be proposed here:
-
1
-
-
Is there an EMB procedure to get a given package available on GetIt? I was thinking that since skia4delphi is now available on GetIt it would be nice to also have TImage32. Of course, it's not hard to install these manually but it does make life a little easier.
-
On 11/27/2021 at 10:47 AM, hsauro said:For some reason I didn't realize image32 was portable, sorry about that. Thanks for the code however, because I wanted to play around a bit more with pixel manipulation with image32.
@angusj I finally got round to looking more seriously Image32, and it's working well so far. In fact, I think I use this instead of GDI+ in the future. Plus as you mentioned earlier it's cross-platform.
-
1
-
1
-
-
14 hours ago, vfbb said:Hello. I adapted your test with Skia4Delphi to directly access the pixels instead of painting the pixel. The result was 45 ms on win64.
Thanks for the example! I was wondering if there was a direct way to get direct access to the pixels from skia4delphi.
-
15 hours ago, angusj said:Hi hsauro. Image32 should be completely cross-platform, so I'd be very interested if you've encountered problems in that regard.
I also doubt this since the drawing is done by directly addressing (ie coloring) every individual pixel (not by using a polygon renderer). There'd be little to no benefit in using another graphics library here. You could perhaps marginally improve pixel addressing by converting the temporary bitmap into a pf32bit pixelformat, getting the base image address (from bitmap.Scanline[bitmap.Height -1]) and efficiently offsetting that pointer to color everything (as per below).
For some reason I didn't realize image32 was portable, sorry about that. Thanks for the code however, because I wanted to play around a bit more with pixel manipulation with image32.
-
I also experimented with caching the scan line pointers, and it seemed to work. I played around a little bit with both image32 and graphics32 but didn’t get very far. The advantage of skia over these other two is that it’s completely cross-platform using the same API and seems to generate very smooth antialiased curves,
-
That is interesting to know, I didn't have the time to try scanline.
-
If anyone is interested in comparing skia (using skia4delphi) versus VCL for drawing points/pixels, here is a quick demo that draws the Mandelbrot set. The VCL drawing code doesn't use scanlines which I know would be faster but just uses Pixel[i,j] which we know is notoriously slow. The skia code uses DrawPoint although I'm not sure if that is the equivalent to Pixels or not
The code also illustrates how you can draw to a skia canvas then copy the result to a TImage. The code could certainly be updated to improve its organization but I didn't have the time.
Code at:
https://github.com/hsauro/Mandelbrot
There is a binary release on Github,
https://github.com/hsauro/Mandelbrot/releases/tag/1.0
I couldn't include the binaries here because the skia dll exceeds the size limit for attachments.
Spoiler Alert: skia was faster.
-
11 hours ago, dummzeuch said:Not going to happen. And neither the IDE.
We have had this discussion too many times already.
I know it’s discussed before but there is not harm in suggesting it again. Some Embarcadero employees read these forums.
-
3 hours ago, BruceTTTT said:Ditto. At least they could tell us when and if it's expected so I could stop checking.
Apparently it’s delayed due to high res dpi issues. It’s good that Embarcadero is having to develop it and discover the problems others have encountered with high res dpi. We might get some fixes as a result.
-
4
-
1
-
-
2 hours ago, David Champion said:or open source the IDE + everything, apart from compilers. Have a licenses that protects EMB investment but allows Pull Requests and co-development with community
At least open source the VCL and RTL
-
What’s been suggested in the first post can already be done to some extent with tms web.
-
1
-
-
3 hours ago, Stefan Glienke said:You're welcome - it is just a slightly improved version of what Aleksandr Sharahov already wrote years ago. Surprisingly they never used his purepascal code which compiles to almost the exact same code as the x86 asm version was doing.
There are more than a dozen other improvements in the RTL that I have worked on - I cannot fix their compiler but I can certainly improve some suboptimal RTL code.
Thanks for doing this, this is one place the community can help. Your efforts might inspire others to contribute.
-
3
-
-
Nice, I’ll try it, I’ve been recently using skia from python so I’m somewhat familiar with it.
-
On 11/5/2020 at 3:55 AM, Fr0sT.Brutal said:I've no idea about numpy and how it organizes its arrays but making array object point to a buffer coming from Delphi is exactly what I meant
Did you ever resolve your question? I am also interested in accessing numpy to and from Delphi.
-
On 3/11/2019 at 8:11 AM, Der schöne Günther said:That looks very exciting, but I do find the prices a bit steep 😶
Does one license work with both RAD Studio and Visual Studio integration?
For VS, does it find leaks for C++/CLI Mixed mode applications?
Doesn’t look that expensive, $99 for personal copy and $399 for developer.
Using pyinstaller with DelphiVCL for Python
in Python4Delphi
Posted
I would post it as an issue to the DelphiVCl GitHub repo. The error shows it can find the moduledefs.json file.