Jump to content

vfbb

Members
  • Content Count

    281
  • Joined

  • Last visited

  • Days Won

    31

Everything posted by vfbb

  1. vfbb

    Loading .webp images into tbitmap?

    Maybe you have the "Webp Image Extensions" installed: https://apps.microsoft.com/detail/9PG2DK419DRG
  2. Yes, this is relevant only for the .aab generation. Note: you can’t change the ‘condition’ on IDE side, you should open the dproj and add it manually. See one dproj with that: https://github.com/skia4delphi/skia4delphi/blob/eed4afbf8a34137a9bfa308bcb5ef87cee84abcb/Samples/Demo/FMX/Projects/RAD%20Studio%2011%20Alexandria/Skia4Delphi.dproj#L1182
  3. vfbb

    No Android Platform in Delphi 11.3

    Did you configure the paths in Tools > Options > Deployment > SDK Manager?
  4. vfbb

    Colored Notification Icon

    Older versions supported multi-color icons (up to Android 6 or 7 if I'm not mistaken). From then on they are treated as mono color. Even if you have your multi-color icon, Android applies a color filter, with the AccentColor color (if the Use Accent Color is selected). When "Use Accent Color" is not selected, your icon will have the default color of the device's theme. Also, in the Android documentation it is stated that the icon should be white, but in practice there is no difference because Android will apply the color filter anyway. Just don't forget to delete your icon's background.
  5. vfbb

    Colored Notification Icon

    Note: notification icons are always monocolor.
  6. vfbb

    Colored Notification Icon

    Did you try Project Options > Icons > Android > Accent Color?
  7. vfbb

    TMapview Android 12

    The FMX still doesn't support the new splash of Android12+ and the issue of the topic is probably generated by the way of the current FMX splash for Android is configured (WindowsBackground=splash in the center). An issue has already been opened on the quality portal to add support for the new splash format on Android12+.
  8. vfbb

    Skia4Delphi

    Yes! See an example: uses Skia, Skia.FMX {or Skia.Vcl}; procedure SvgStreamToImageStream(const AInputSvgStream, AOutputImageStream: TStream; const AImageWidth, AImageHeight: Integer; const AFormat: TSkEncodedImageFormat = TSkEncodedImageFormat.PNG); var LSurface: ISkSurface; LSvgBrush: TSkSvgBrush; LSvgBytes: TBytes; begin SetLength(LSvgBytes, AInputSvgStream.Size - AInputSvgStream.Position); AInputSvgStream.ReadBuffer(LSvgBytes, Length(LSvgBytes)); LSurface := TSkSurface.MakeRaster(AImageWidth, AImageHeight); LSurface.Canvas.Clear(TAlphaColors.Null); LSvgBrush := TSkSvgBrush.Create; try LSvgBrush.Source := TEncoding.UTF8.GetString(LSvgBytes); LSvgBrush.Render(LSurface.Canvas, RectF(0, 0, AImageWidth, AImageHeight), 1); finally LSvgBrush.Free; end; LSurface.MakeImageSnapshot.EncodeToStream(AOutputImageStream, AFormat); end;
  9. vfbb

    Skia4Delphi

    The library itself does not require a GPU. There is a raster backend that uses only CPU. It should work normally, I even ran it on Windows Server normally. On the other hand, I saw that SkiaSharp already had problems with the Nano Server, so the more information you can give, the better it will be. I suggest opening an issue on the project's github with all the information you have. Skia4Delphi GitHub - Issues
  10. v5.0.0 Added GPU backend render to TSkAnimatedPaintBox in Vcl; #108 Controls Rewritten Canvas, addressing all pending issues and further enhancing performance; #201 #40 FMX Render Improved performance of TSkAnimatedImage in Vcl; Controls Improved anti-aliasing through multi-sampling; FMX Render Improved library reliability through more unit tests; Tests Fixed numerous minor issues and improved the wrapper as well as the C++ code; API Fixed compilation to Android on RAD Studio Rio; #206 API Fixed issues related to transparency and addressed problems with OpenGL in fullscreen mode on Windows #127; FMX Render Fixed deployment for custom build config; #208 Library Fixed custom font in TSkAnimatedImage; #203 Controls Fixed support for Android 5 and Android 6 broken in last version; Library Deprecated SkParticles since Skia stopped maintaining it at Milestone 112; API Minor improvements. Skia version: 107.2.0 Compatibility break We changed very specific APIs, which are unlikely to generate incompatibilities for developers, but a new major was necessary because we faithfully follow the semantic version. Github: github.com/skia4delphi/skia4delphi Website: skia4delphi.org
  11. vfbb

    Skia4Delphi

    Google Skia decision. Just as FMX decided to only encode PNG or JPEG, Skia decided to only encode PNG, JPEG and WEBP (the same goes for other languages). Maybe it's because they only adopted the formats that are widely used on all platforms. Decoding a variety of formats, which already occurs, is really the most important thing. In addition, the accepted formats already meet the needs of the vast majority.
  12. vfbb

    Skia4Delphi

    Just to discover the image format? You can use the TSkCodec.MakeFromStream(LStream).EncodedImageFormat
  13. Let's do it by steps. Few users had problems when updating to version 4, but all who had problems were due to conflicts with older versions of Skia4Delphi installed on the machine. So, for a secure installation, follow these steps: Install running the setup (the manual installation is not recommended) with the IDE closed. You can choose always the same destination folder (prefer the default folder to avoid administrator permission), even if there is an old installation there. Delete old Skia4Delphi folders that you detect on your computer. Check in your "RAD Studio > Options > Language > Delphi > Library > Library Path >" if there is any other skia directory besides these: Check in your "RAD Studio > Component > Install Package" if there is any other skia package besides these: Never drop library files into the RAD Studio folder. The bpls in the bds folder are automatically loaded by the IDE, even though they are not in the Search Path / Registry. If you've ever done that, you should delete them. You should also understand that there are 2 enablements in the library: To add or remove the App library, right-click on the project and choose "Enable Skia" or "Disable Skia". You will only be able to use controls or any unit from the library after this enablement. You can enable replacing the FMX render with the Skia render by adding the line "GlobalUseSkia := True;" and "Skia.FMX" in dpr uses. This is a completely optional feature, as the library controls work fine without this feature. I also emphasize that some libraries are not compatible with Skia's rendering, such as Alcinoe. But we always recommend this feature as it improves the quality of the application's graphics, and fixes several issues that exist in the default FMX render. If you removed the library via step 1 ("Disable Skia" menu) and removed the library units / controls from your form, your application will not have any code from the library running and therefore the exception that remains has nothing to do with the library. About the lack of borders in the TMS controls, does this happen with the Skia render ("GlobalUseSkia := True;"), or without the Skia render? You can check at runtime which render is enabled by giving a simple ShowMessage: procedure TForm1.FormCreate(ASender: TObject); begin ShowMessage(TCanvasManager.DefaultCanvas.ClassName); end; There are 4 implementations of Skia rendering, so it will be Skia rendering if the ShowMessage returns one of the following classes: TSkRasterWindowsCanvas, TGlCanvas, TMtlCanvas, TSkRasterMacOSCanvas
  14. vfbb

    Skia component and IDE

    The BPL’s of some specific paths are loaded automatically when the IDE opens, even if it isn’t in registry.
  15. v4.0.0 Skia library version has been updated from Milestone 98 to 107; [API] Added support for iOS Simulator ARM 64-bit to RAD Studio 11.2 Alexandria or newer. [API] Added TBitmap.CreateFromSkImage; [Framework] Added LinesCount and DidExceedMaxLines properties to TSkLabel; [Framework] Added new splashscreen to our main demo; [Samples] Added ISkParagraph.Visit method; (#136) [API] Rewritted TSkAnimatedImage and TSkAnimatedPaintBox, adding features to have full control over the animation; (#104) [Framework] Some of them are: Start and Stop methods, and AutoReverse, CurrentTime, Delay, Duration, Enabled, Inverse, Loop, Pause, Progress, Running, Speed, StartFromCurrent, StartProgress and StopProgress properties. All these properties and methods are in the Animation property of the TSkAnimatedImage and TSkAnimatedPaintBox. Improved automatic tests; [Tests] Fixed issue in edit controls with emoji or Chinese char; (#159) [Render] Fixed custom fonts on Android deployed to assets\internals that was not automatically loaded; (#153) [Render] Fixed webinar demo splashscreen; [Samples] Fixed exception loading images from stream or bytes; (#111) [Framework] Fixed TSkAnimatedImage exceeding bounds in some WrapMode [Framework] Fixed TBitmap.SkiaDraw issues in VCL; [Framework] Fixed TBitmap.ToSkImage AV in VCL; [Framework] Fixed flicker problem in TSkAnimatedImage in VCL; [Framework] Fixed text print; (RSP-16301) [Render] Fixed TSkAnimatedImage with 90° rotation that fails to play; [Framework] Fixed high DPI issues of TSkLabel in VCL; [Framework] Fixed high DPI issues in VCL demo; [Samples] Fixed SkRegion.IsEqual; [API] Fixed link with runtime packages; (#163) [Setup] Fixed big GIF issue; (#118) [API] Fixed wrong pixel format on Android in Delphi 10.3 Rio; [Render] Minor improvements and fixes. Skia version: 107.0.0 Compatibility break We are in continuous development, so some updates will bring compatibility breaks. So, pay attention to version numbers, we use semantic versions (for major versions there is some compatibility break). See some breaking changes in this version: No longer use TSkAnimatedImage.Enabled to start or stop an animation. Now use TSkAnimatedImage.Animation.Enabled. The class TSkTypefaceManager is deprecated in favor to TSkDefaultProviders; Several changes in API (Skia.pas); Supported platforms RAD Studio 11 Alexandria: All platforms RAD Studio 10.3 Rio or newer: Windows and Android RAD Studio XE7 or newer: Windows Github: github.com/skia4delphi/skia4delphi Website: skia4delphi.org
  16. vfbb

    ANN: Skia4Delphi v4.0.0

    v4.1.0 Added new parameters to SkCanvas.SaveLayer; API Added functions ComputeFastBounds and CanComputeFastBounds to SkImageFilter; API Added the properties ApproximateOpCount and ApproximateBytesUsed to SkPicture; API Added ShaderButton demo in VCL & FMX (presented at the Embarcadero Brazil Conference 2022); Samples Added virtual methods to TSkLabel; #182 Controls Added support for beta versions of RAD Studio; Setup Improved codecs load; Render Fixed support for iOS Simulator ARM64; #186 Library Fixed invalid float point operation in texts; Render Fixed trimming issue in TTextLayout; #192 Render Fixed Skia's codecs color type on mobile with Skia's render disabled; #197 Render Fixed ISkPath.IsRect results; API Fixed read of Metal view; Render Fixed cursor in TSkLabel of VCL; Controls Fixed text attributes; Render Fixed controls inside TSkCustomAnimatedControl in VCL; Controls Fixed TextLayout before 10.2 Tokyo; Render Fixed iOS certificate issues in main demo; Samples Fixed NavigationBar color on Android12+ in main demo; Samples Fixed and improved unit tests; Tests Minor improvements. Skia version: 107.1.0 New ShaderButton demo (VCL & FMX) ShaderButton.MP4
  17. vfbb

    Upload Google Play android FMX app problem

    You should edit your AndroidManifest.template.xml (You can found it template in your dproj folder after the first compilation to android platform), and not the final AndroidManifest in deploy path.
  18. vfbb

    Upload Google Play android FMX app problem

    Open your Android manifest template, and inside the activity tag, put the line: android:exported="true"
  19. vfbb

    No support for RTL languages in TListView ?

    Not! This part is exemplifying the direct use of the API. It's exactly like @Sherlock said, just replace the default FMX renderer with Skia's renderer ("GlobalUseSkia := True;" in your dpr). But there are a few more notes in the RightToLeft section in readme, which I've printed here:
  20. vfbb

    No support for RTL languages in TListView ?

    FMX does not natively support RTL. However, it is possible to use third-party libraries that enable RTL in FMX. Skia4Delphi is one of them: https://github.com/skia4delphi/skia4delphi#right-to-left
  21. When I said similarity of images, I meant similarity of pixels. It can check if the image is identical (similarity = 1) or if it is very close (similarity >= 0.99 for example). We use this because it is normal for some drawings to vary a few pixels from platform to platform or from backend render to backend render. For example, text on Windows is slightly different from text on Android, even though both have the same font loaded. So in the unit tests we set up some tolerable similarity for each type of drawing.
  22. If you just want to check if 2 images are identical or similar, I have an optimal solution: The Skia4Delphi unit test has an independent unit of image hashing (or similarity hashing). https://github.com/skia4delphi/skia4delphi/blob/main/Tests/Source/Skia.Tests.Foundation.ImageHash.pas Basically, this class allows you to: - Compare 2 images and return the similarity between them (0..1) - Generate a hash of the image - Compare an image with a previously generated hash and return the similarity (0..1) Note: It may seem strange but the hash it generates is a hash itself for similarity, that is, if you change part of the image, only part of the hash will be changed. Internally it implements 3 known similarity algorithms (like perceptual hash) and one of our own. The union of the 4 algorithms is to increase the final accuracy. Logically there is a margin of error, but the accuracy is excellent. You can put for example a check to see if the hash similarity is >= 0.99 to decide if they are equal. In the class, the input parameters of the images are of type ISkImage, which can be created in two different ways: - TSkImage.MakeFromEncoded(Bytes) - Bitmap.ToSkImage; Note: Add the units Skia and Skia.Vcl (or Skia.FMX), to use the example above.
  23. vfbb

    Project Magician blues

    @Uwe Raabe I also wanted to suggest adding a flag to remove the jars. If I remove the android jars from a dproj, I can use the same dproj in any version of Delphi (the IDE will set the default jars when open it). But if I don't remove it, I have to do a 'Revert To Defaults' when I open the project (and an amateur programmer doesn't even know this, will compile and see an error and give up). The solution would be: either add a flag to remove them or check if the list of jars is the defaults of some version of RAD Studio and if it will remove it automatically.
  24. vfbb

    Converting C++ API Post Request into Delphi Code

    You can try using Refit, which is a library to consume apis rest in a simple way, without manipulating strings, json, or http components. First you would create a unit for your api: unit CheckBook; interface uses iPub.Rtl.Refit; // Just download and add it to your project: https://github.com/viniciusfbb/ipub-refit type TNewPayment = record Recipient: string; Name: string; Amount: Double; Number: string; Description: string; end; [BaseUrl('https://sandbox.checkbook.io/v3')] ICheckBookApi = interface(IipRestApi) ['{97789B20-5C26-4359-AC41-D2042C4FAEC7}'] [Post('/check/digital')] [Headers('Authorization', '{AuthToken}')] function CreateDigitalPayment(const ABody: TNewPayment): string; function GetAuthToken: string; procedure SetAuthToken(const AValue: string); property AuthToken: string read GetAuthToken write SetAuthToken; end; var FCheckBookApi: ICheckBookApi; implementation initialization FCheckBookApi := GRestService.&For<ICheckBookApi>; end. Then you would consume it in your forms as follows: uses CheckBook; procedure TForm1.Button1Click(Sender: TObject); var LNewPayment: TNewPayment; begin LNewPayment.Recipient := 'testing@checkbook.io'; LNewPayment.Name := 'Widgets Inc.'; LNewPayment.Amount := 5; LNewPayment.Number := ''; LNewPayment.Description := 'Test Payment'; FCheckBookApi.AuthToken := 'xxxxxxxxx:xxxxxxxx'; ShowMessage(FCheckBookApi.CreateDigitalPayment(LNewPayment)); end;
×