-
Content Count
266 -
Joined
-
Last visited
-
Days Won
30
Everything posted by vfbb
-
Question about installing Skia on RAD Studio Community v10.4
vfbb replied to TimCruise's topic in Delphi IDE and APIs
@TimCruise Fixed in new release. -
The delphi string is an implementation of UTF-16 in which the "normal" graphic characters corresponding to 1 Char (2 bytes), but having others graphic characters being represented by 2 Chars (4 bytes), the so-called surrogate pair, (like the emoji 🙏). And in this case we need to check if the char IsSurrogate, to know that it is a graphic character of 2 Chars (4 bytes). But the problem is that utf-16 is not limited to a maximum of 4 bytes for a graphic character, in fact it already predicts that a graphic character can have up to 14 bytes for future implementations, and today most of the emojis already occupy at least 8 bytes (like the emoji 🙏🏻 <- light version). This is a problem, because delphi only handles the graphic character with the possibility of being 2 bytes or 4 bytes, and is often converting the graphic character or string to UCS4Char or UCS4String respectively, to treat everyone as being 4 bytes. So, how do you know the actual size of each graphic character in a string?
-
Unicode string - how element iterating?
vfbb replied to vfbb's topic in RTL and Delphi Object Pascal
We finally have the solution to the problem. Feature added to Skia4Delphi library and works on all platforms. See the results: -
Is anyone managing to use the storyboard launch screen? Here it is only working with the original delphi color and image. When I try to change the background color or the image in the project options, it has no effect.
-
Consider using GrijjyDeployMan to add multiple files, you can add an entire folder instead of files by files.
-
The correct way is to rotate only the drawing you are doing, in this case the text. For this you must rotate by ISkCanvas: uses System.Math, System.Math.Vectors, Skia; procedure TForm1.SkPaintBox1Draw(ASender: TObject; const ACanvas: ISkCanvas; const ADest: TRectF; const AOpacity: Single); var LDest: TPointF; begin LDest := PointF(150, 50); ACanvas.Clear(TAlphaColors.Null); ACanvas.Save; try ACanvas.DrawSimpleText('Skia4Delphi 1', LDest.X, LDest.Y, TSkFont.Create, TSkPaint.Create); ACanvas.Rotate(90); LDest := LDest * TMatrix.CreateRotation(DegToRad(-90)); ACanvas.DrawSimpleText('Skia4Delphi 2', LDest.X, LDest.Y, TSkFont.Create, TSkPaint.Create); finally ACanvas.Restore; end; end; Results: Note: I made the adjustment of LDest with TMatrix.CreateRotation because when rotating the canvas, its X and Y of DrawSimpleText are also rotated.
-
@hsauro What exactly do you want to do? Draw text around a circle? Do you have any image of what it would be like? Drawing text along a path is not trivial, but depending on what it is, we can try to make a non-morphing example, just using letter rotation.
-
Fix: I think he meant below Professional (Starter, Community and Trial). I looked at each Feature Matrix of the RAD Studio versions and questioned him, the compilation via command line feature varies a lot from version to version including from update to update. Some in the Starter edition only have the command line for Win32, others not even for Win32.
-
Question about installing Skia on RAD Studio Community v10.4
vfbb replied to TimCruise's topic in Delphi IDE and APIs
@TimCruise Now all makes sense! Your installation did not generate dcus or bpls because Delphi 10.4.2 CE does not allow compilation via command line. We will solve this problem in the next version. Thank you so much for reporting. -
One of the embardero consultants informed me here that neither the Comunity Edition nor the Professional version has the compilation via command line. He even said he's not sure, but he doesn't think even the trial version has it. This is definitely too bad.
-
I did not know. Doesn't work even using msbuild? Even just for win32?
-
Quite OK Image (QOI) image format
vfbb replied to dummzeuch's topic in Algorithms, Data Structures and Class Design
I believe that for general purposes, a great image format option would be WebP. It has the same performance as PNG but compresses 30% more in lossless mode. In lossy mode, it compresses 30% more than jpeg (with same quality) and still allows transparencies. It is a format that also allows animated images such as gif. It is supported by all browsers, many softwares, and even Windows 10 already displays thumbnails in folders. As for the future, I would bet on Heif. There are already many libraries that support it but most in beta mode, like skia. Compatibility is very important, I wouldn't bet on a format that image editors, viewers or browsers can't open. -
Question about installing Skia on RAD Studio Community v10.4
vfbb replied to TimCruise's topic in Delphi IDE and APIs
I'm preparing a new demo right now. It will also be part of the next release. -
Question about installing Skia on RAD Studio Community v10.4
vfbb replied to TimCruise's topic in Delphi IDE and APIs
The installer should have done this, it's working fine for dozens of developers. Something is blocking the build during installation, maybe an antivirus. Maybe you have run as administrator (which is not necessary) and windows defender blocked the build... Anyway, in a few weeks we will have a new version with a new installer and a code certificate that will avoid these blocks. -
Question about installing Skia on RAD Studio Community v10.4
vfbb replied to TimCruise's topic in Delphi IDE and APIs
Ok. In the previous folder also does not have any files? "Skia4Delphi\Library\Delphi10Sydney\Win32\Release\" If you don't have any files either, check your rsvars.bat, "C:\Program Files (x86)\Embarcadero\Studio\22.0\bin\rsvars.bat", if it contains the same content: @SET BDS=C:\Program Files (x86)\Embarcadero\Studio\21.0 @SET BDSINCLUDE=C:\Program Files (x86)\Embarcadero\Studio\21.0\include @SET BDSCOMMONDIR=C:\Users\Public\Documents\Embarcadero\Studio\21.0 @SET FrameworkDir=C:\Windows\Microsoft.NET\Framework\v4.0.30319 @SET FrameworkVersion=v4.5 @SET FrameworkSDKDir= @SET PATH=%FrameworkDir%;%FrameworkSDKDir%;C:\Program Files (x86)\Embarcadero\Studio\21.0\bin;C:\Program Files (x86)\Embarcadero\Studio\21.0\bin64;C:\Program Files (x86)\Embarcadero\Studio\21.0\cmake;C:\Users\Public\Documents\Embarcadero\InterBase\redist\InterBaseXE7\IDE_spoof;%PATH% @SET LANGDIR=EN @SET PLATFORM= @SET PlatformSDK= -
Question about installing Skia on RAD Studio Community v10.4
vfbb replied to TimCruise's topic in Delphi IDE and APIs
What files have in your folder "Skia4Delphi\Library\Delphi10Sydney\Win32\Release\", after installation? -
Question about installing Skia on RAD Studio Community v10.4
vfbb replied to TimCruise's topic in Delphi IDE and APIs
@TimCruise You will have to remove these two registries and reinstall skia4delphi. But to be sure, follow the steps: 1) Uninstall via GetIt (if you haven't already) 2) With your RAD Studio closed, delete these two skia records in "HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\21.0\Disabled Packages" 3) Go to Windows Configurations > Applications > search for Skia4Delphi (if found, uninstall it with your RAD Studio closed). 4) Check if the file "C:\Users\Public\Documents\Embarcadero\Studio\Skia4Delphi\unins000.exe" exists, if so, run it to uninstall. 5) Install the Skia4Delphi running the "Skia4Delphi_2.0.1_Setup.exe", because some uses have reported problems using out GetIt package in Sydney. In setup's platforms screen, select just the platforms that your IDE is already to compile. 6) After installation, try to run our sample "skia4delphi\Samples\Basic\FMX\Skia4Delphi_Basic.dproj" -
Question about installing Skia on RAD Studio Community v10.4
vfbb replied to TimCruise's topic in Delphi IDE and APIs
Yes, my brother and I are the authors. Right. I suspect that some unsuccessful install is hampering new installs, but I need more information: 1) Did you install only using installer (Skia4Delphi_2.0.1_Setup.exe) or did you try another method (GetIt or manual)? 2) Was there an error during an installation? If so, do you still have the Build.Logs.txt that is generated in the folder you installed skia4delphi in? 3) Access RegEdit.exe, and take a screenshot of "HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\21.0\Known Packages" and "HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\21.0\Disabled Packages". -
Question about installing Skia on RAD Studio Community v10.4
vfbb replied to TimCruise's topic in Delphi IDE and APIs
Very strange. If you find any problems during use, open an issue so we can investigate further. -
Question about installing Skia on RAD Studio Community v10.4
vfbb replied to TimCruise's topic in Delphi IDE and APIs
Just reinstall the Skia4Delphi and the new platform will be available at installation. -
Question about installing Skia on RAD Studio Community v10.4
vfbb replied to TimCruise's topic in Delphi IDE and APIs
Now that's a mistake. Probably the folder you are installing requires administrator permission and you have not run the installer as an administrator. The solution in this case is to uninstall and install in the default folder that the installer suggests (does not require admin permission). -
Question about installing Skia on RAD Studio Community v10.4
vfbb replied to TimCruise's topic in Delphi IDE and APIs
@TimCruise There is but you need a macOS to install the SDK in your RAD Studio. It's even possible to run macOS on windows with VMWare, but that's probably illegal. Anyway, with the SDK installed you'll only be able to compile, the simulator doesn't work, you'll have to have an iPhone too. Without the SDK, you won't even be able to compile a blank project for the platform you want. About the Skia4Delphi installer, basically it checks if it is possible to compile for the platform, so if your delphi is really ready to compile for the platform, then yes it will appear available to be selected in its installation. -
Question about installing Skia on RAD Studio Community v10.4
vfbb replied to TimCruise's topic in Delphi IDE and APIs
@TimCruise The installer automatically detects the platforms installed in your RAD Studio. Platforms that are disabled are those that have not yet configured the SDK in your IDE. Install the SDK of the platform you want on your delphi and then reinstall Skia4Delphi. -
Hello. I adapted your test with Skia4Delphi to directly access the pixels instead of painting the pixel. The result was 45 ms on win64. procedure TfrmMain.Button3Click(Sender: TObject); procedure DrawMandelbrotPixmap(APixmap: ISkPixmap; X, Y, au, bu: Double; X2, Y2: Integer); var c1, c2, z1, z2, tmp: Double; i, j, Count, rgb: Integer; hue, saturation, value: Double; begin c2 := bu; for i := 10 to X2 - 1 do begin c1 := au; for j := 0 to Y2 - 1 do begin z1 := 0; z2 := 0; Count := 0; // count is deep of iteration of the mandelbrot set // if |z| >=2 then z is not a member of a mandelset while (((z1 * z1 + z2 * z2 < 4) and (Count <= 50))) do begin tmp := z1; z1 := z1 * z1 - z2 * z2 + c1; z2 := 2 * tmp * z2 + c2; Inc(Count); end; // The color depends on the number of iterations hue := count / 50; saturation := 0.6; value := 0.5; PCardinal(APixmap.PixelAddr[i, j])^ := HSLtoRGB(hue, saturation, value); c1 := c1 + X; end; c2 := c2 + Y; end; end; var au, ao: Double; dX, dY, bo, bu: Double; LWidth: Integer; LHeight: Integer; LTimer: TStopwatch; LBitmap: TBitmap; LSurface: ISkSurface; begin LTimer := TStopwatch.StartNew; LWidth := Image1.Width; LHeight := Image1.Height; LSurface := TSkSurface.MakeRaster(LWidth, LHeight); LBitmap := TBitmap.Create(LWidth, LHeight); try ao := 1; au := -2; bo := 1.5; bu := -1.5; // direct scaling cause of speed dX := (ao - au) / (LWidth); dY := (bo - bu) / (LHeight); DrawMandelbrotPixmap(LSurface.PeekPixels, dX, dY, au, bu, LWidth, LHeight); LBitmap.SkiaDraw( procedure (const ACanvas: ISkCanvas) begin ACanvas.DrawImage(LSurface.MakeImageSnapshot, 0, 0); end); Image1.Picture.Assign(LBitmap); finally LBitmap.Free; end; Showmessage(LTimer.Elapsed.TotalMilliseconds.ToString+' ms'); end; However, your benchmark isn't accurate, you're basically changing pixel by pixel, it's not a good way to measure drawing library performance. Also, tasks that change an image pixel by pixel almost always perform better by creating a shader to run on the GPU. This is another advantage of Skia4Delphi, as it allows you to create shaders at runtime through the Skia Shader Language (based on GLSL). Even now I'm preparing a VCL sample of an animated shader, see the performance: 27.11.2021_01.05.45_REC.mp4 27.11.2021_01.05.45_REC.mp4
-
Currently skia4delphi closed beta supports gif on all platforms. The next release will be available in 2 weeks.