Jump to content

Rollo62

Members
  • Content Count

    1945
  • Joined

  • Last visited

  • Days Won

    24

Everything posted by Rollo62

  1. Hi there, recently I've got some insights, about the internal TBitmap magic in FMX, for the following code snippet, under Android: procedure TTestForm.SaveImageToTemporaryStore( const AImage : TBitmap; const AArrayList : JArrayList; const AIndex : Integer ); var LImageFile : JFile; LImageUri : Jnet_Uri; LOutputDir : JFile; LPath : String; begin // Retrieves the apps cache, temporary file storage folder LOutputDir := TAndroidHelper.Context.getExternalCacheDir(); // Creates a temporary file in that cache folder LImageFile := TJFile.JavaClass.createTempFile( StringToJString( 'attachment' + AIndex.ToString ), StringToJString( '.png' ), //<== This is the only palce where png comes into play LOutputDir ); // Get that file as URI LImageUri := TAndroidHelper.JFileToJURI( LImageFile ); // Retrieve that path, for testing purposes, it looks like this: // '/storage/emulated/0/Android/data/com.embarcadero.APPNAMEHERE/cache/attachment05833119307942135994.png' LPath := JStringToString( LImageFile.getAbsolutePath ); // Save the TBitmap to that IRI file Path, works pretty well AImage.SaveToFile( LPath ); That works well and all as expected. When I send that file via sharesheet then after, also that works fine. // If we use ACTION_SEND_MULTIPLE action of Intent, we should put image throught Parcelable Array List. // Because in this case other application read EXTRA_STREAM like a ArrayList<Uri> // Created externally by LArrayList := TJArrayList.Create; AArrayList.add( LImageUri ); end; Then finally this is added to an Intent, to share to other apps. That works well, put it as below into the Intent as EXTRA_STREAM, it sends the .png file via different apps: LIntent.putParcelableArrayListExtra( TJIntent.JavaClass.EXTRA_STREAM, LArrayList ); So all works well and I should not complain. But it struck my, when I asked myself: Why does the source TBitmap converts to a *.png file in the first place ? Why didn't I had to fumble around with TBitmapCodecManager or something else, to get this conversion coded ? After some investigation, looking into the TBitmap.SaveToFile( LPath ); I found that the trick, by hidden conversion, depending on the file extension: procedure TBitmap.SaveToFile(const AFileName: string; const SaveParams: PBitmapCodecSaveParams = nil); var Surf: TBitmapSurface; begin TMonitor.Enter(Self); try Surf := TBitmapSurface.Create; try Surf.Assign(Self); if not TBitmapCodecManager.SaveToFile(AFileName, Surf, SaveParams) then raise EBitmapSavingFailed.CreateFMT(SBitmapSavingFailedNamed, [AFileName]); finally Surf.Free; end; finally TMonitor.Exit(Self); end; end; Sometimes, I'm still surprised by the hidden convenience that Firemonkey provides for us. Under VCL I would have to convert this image the hard way by myself, for example with TPNGImage, like PeterBelow pointer out here. I'm always happy when FMX made me forget such nasty details
  2. Rollo62

    PDF to PNG and PNG to PDF

    Oh my, I didn't notice that, my sincere condolences So I hope he is well productive on the next level now.
  3. Rollo62

    PDF to PNG and PNG to PDF

    That sounds like a simple task, but turns out to be quite complex and difficult. I would tend to use integrate external tools, which is maybe the simplest way, but also there are not many simple ones. Probably ImageMagick, GhostScript, ... Not sure if Pdfium can do this Probably Debenu can do this, but is maybe not supported any longer, not sure. https://github.com/Belval/pdf2image https://github.com/oschwartz10612/poppler-windows UberPdf is probably dead
  4. Rollo62

    User Drawing of Lines and Curves

    Yes, I use TPath too, a lot. Works nice and reliable and is probably the most simple way to do that in FMX. Nevertheless, if you need more advanced drawing, I would look into SVG and/or into TImage32 from Angus, or even into SkiaForDelphi from Vinicious and friends.
  5. Rollo62

    FMX Tabcontrol Tab Hight

    Same do I The advantage of frames is, that you can mimic any complex component even with many complex controls, and other frames, inside. Offering the ability to visually create and separately test them nice and easy, without the need to install them in the IDE on every change. The only drawback is, that you cannot drag-and-drop (although you could, but this RAD approach seems not reliable too me), but you have to use them at runtime instead. But for me this is a benefit, not a drawback 🙂
  6. An External exception is mostly the worst case, since this usually happens before you have any control over the app. Very likely, this is caused by any permission or forbidden access problems. I've learned the hard way, that it makes much sense to massively modularize the app and separate and encapsulate all specific features, to simplify separate feature testing on different devices. Monolithic apps are so Windows - 1990 This philosophy doesn't work any more on mobile. With ifdef defines, I can add/remove/compose certain features fast and easy, for step-by-step testing purposes, without touching the whole app. That way, I can produce test-apps for specific customers, which are able to reproduce and test errors. I use also massive logging, to follow the patch in the app, which also can be used in released apps.
  7. Rollo62

    Getting current Style value and changing style.

    Doesn't the TextSettings property work for you ? https://docwiki.embarcadero.com/Libraries/Sydney/en/FMX.Graphics.TTextSettings
  8. Rollo62

    FMX Tabcontrol Tab Hight

    I usually don't rely on the TabControl UI for multi-plattform. The TabControl itself works fine, but I remove its visual Tabs and use separate navigation controls to switch between Tabs, for example simple TButton's in a separate TLayout. That way I have full control over behaviour and appearance and the UI and the navigation can even separated from the tab-control itself, or even easily replaced by different visual impressions for different device categories ( phone, tablet, desktop).
  9. Rollo62

    [Android] How to put data from a dataset into a listbox?

    If speed is your issue here, then maybe because you try to use too many items in the ListBox. Perhaps, better switch to TListView then ?
  10. Rollo62

    ANN HTML Library 4.7 released

    @Alexander Sviridenkov That looks great, as always. I'm not sure if the performance, SVG and large-file features were limited to VCL and desktop mostly, or if also mobile apps will improve a lot, with or without SKIA ?
  11. Although this should be possible with Rx11.2, you should be aware that you are touching quite a lot of critical Android stuff, which needs each a lot of experience and knowledge, like - sensors and location - permission handling - I assume you would like to have background operation - therefor you would need Android services very likely I am not sure, if you start with a new project with Rx11.2 on Android for the first time. That's why I think this maybe quite a big task to get a smooth and easy start. Better try and test each of those problem zones separately, instead of putting it all together in the first try.
  12. Rollo62

    OCR for iOS and Android

    ImageEN is great, but unfortunately VCL only, and Windows specific.
  13. Rollo62

    Replacement for TBits?

    Yes, I think there are many applications, physics, math, measurements, even finance .... But I think Delphi is not the first choice for those applications. Anyhow, it would be great to get a little bit of info, about what initial problem should be solved, since this may have many complete different solutions paths too. Just to have a huge chunk of bits is one, maybe some kind of bit-compression could be another one, especially if only 5% of the bits really need to be "1". How about finding useful bit-combinations, to encode larger chunks into something like enhanced HEX code or the like, to save a lot of space in smaller memory ? Without a little more information, it's like poking in the fog.
  14. Rollo62

    Replacement for TBits?

    I still have no clue why the heck Jud needs 300 Billion Bits in memory in the first place. Aren't there really no optimizations in the algorithm or processing task possible somehow ?
  15. Rollo62

    iOS 17

    That sounds a very likely candidate, have you tried to isolate the StoreKit parts in your app and tried to run without it ? Does it still crash ?
  16. Rollo62

    iOS 17

    Not looked into ios17 yet, but usually crashes were caused by changed permission stuff. Have you checked which parts have changed, is there already the documentation available ? Maybe looking into the changed parts might give a clue.
  17. Maybe they only want to wait until the EU directive related to AI is final, to copy-and-paste it. Probably the EU proposal might be faster, since the EU commission was getting hyper-accelerated in bureaucracy a lot over the past 1-2 years
  18. Rollo62

    VCL Wrap

    Not sure what you mean, didn't I say exactly that above ? Anyway, a third approach could be thinkable, a complete "interposer-replacement", by replacing all the original system units of the original installation at once, by their same unit names with imposer wrappers. Which then have the effect that you don't need to install new components or replace existing ones, just adding an intermediate layer to all system units with the same system unit name and classes. That's just an idea, never checked that, because it's too much effort, but maybe that is a reasonable combination of my 1st and 2nd approach, to replace all system components at once to be their interposers. Must check that idea one day, should be possible too.
  19. Rollo62

    Replacement for TBits?

    Like said, just an alternative idea, with pros and cons. Only @Jud may know if this is workable for him somehow, or not.
  20. Rollo62

    Replacement for TBits?

    How about the idea to store this in a 2D-image as Bitfield, of maybe 17320x17320 pixel ? Of course storage will be maybe more efficient, but access would be slower. Thinking further, using such Bitfield with involvement of the GPU ....
  21. Rollo62

    VCL Wrap

    Accepted, yes, but maybe from a purist's standpoint this is not what is recommended. What I like from the imposer is, that this perfectly can extend or repair missing standard components' behavior, without the need to install new components, while still working well under the IDE Designer if you don't mess up things. Existing projects still work and can be easily extended. The drawback is that this is kind of "magic", just to add your wrapper unit in the uses clause and suddenly a new behavior appears, I think this is the reason why many people dislike it. Another approach, which is maybe more clean, but clumsy, would be to use consequently your own set of standard component wrappers. Like TEdit => TEditEx, TLabel => TEditEx, TButton => TButtonEx, ... as intermediate wrapper-layer around every standard components. That way you need to install small wrappers to any existing components by default, with the option to extend or repair those wherever needed. This is maybe more clean, but has also a huge impact on projects, since you should only use your new components then and never use a normal standard TButton anymore.
  22. Rollo62

    Apple Transporter Error

    I assume you used the same *.dproj from D10.4.x under D11, right ? The "auto-migration" from the IDE to migrate an older project file doesn't always work out for me. For such kind of problems I always use a new, empty project, under a new IDE like D11, which has usually preset everything correctly. The only drawback is that you have to re-set every option for your project, to make the D11 compatible to the D10 project, Usually with a clean project you have a much better starting point under a new IDE.
  23. Rollo62

    Apple Transporter Error

    It seems that D10.4 Transporter setup is working for you. So, if you have two Macos Transporter setups, one for 10.4. and 11, have you tried to create the IPA with D11 and to upload this IPA on the D10.4 Transporter ? I think the transporter is a separate app, and should be working with any valid IPA version. This is just a simple upload tool, and I think the main tests were done in the AppStore.
  24. Hi there, there is a new security update out, but all in all, the whole Ventura leaves a bad taste for me. Lots of performance issues forced me to move to Windows-hardware, so I'm waiting for the next big macOS bugfix for my Intel MacBook Pro 2018. I'm afraid the new security update 13.4.1 is NOT the big bugfix yet: https://www.gottabemobile.com/macos-ventura-problems-5-things-you-need-to-know/ Do you have any experiences or performance tips with Ventura so far, or the latest update ?
  25. Rollo62

    macOS Ventura 13.4.1, any comments ?

    Thanks, so you use the newest version 13.4.1 without special issues ? I think you mean this OpenCore, the kindof bootloader. Since OpenCore ist not the official OS, do you face any issues with AppStore uploads, TestFlight, reviews, or the like ? I use Macos normally, to prevent any additional issues with uploading or review of the apps in the Apple universe.
×