Recent

Author Topic: Error after adding an icon.  (Read 1141 times)

shyub

  • Full Member
  • ***
  • Posts: 144
Error after adding an icon.
« on: May 04, 2024, 06:46:09 am »
I'm testing LAMW-0.8.6.4. I create a project without an icon, save it and close Lazarus. I open the LPR file, install the components, and describe the functionality. After each change, I compile and test it on the NOX-player emulator. So far everything is working. I add an icon (PNG file 192x192) and after that GRABLE-8.5 throws an error.
Similarly, I create an empty form, compile and check it in the emulator. I add an icon and again the same error...
What could be the reason?
« Last Edit: May 04, 2024, 06:53:24 am by shyub »

shyub

  • Full Member
  • ***
  • Posts: 144
Re: Error after adding an icon.
« Reply #1 on: May 04, 2024, 08:43:03 am »
The problem is related to resources. The thing is that ...res\mipmap-... contains images in PNG format, but they should be WEBP...
(It is possible that some older projects also do not compile due to resource reasons).
Until LAMW provides a mechanism for either converting PNG to WEBP, or at least PNG will not be automatically written to ...rc\mipmap..., then I simply deleted PNG from these folders, and instead of the standard ones I placed the icons I needed.
After this, the project was able to be compiled and run in the emulator.
However, the window began to be positioned horizontally at any screen position. I had to explicitly specify the window position ("ssSensor" does not work):

Code: Pascal  [Select][+][-]
  1. procedure TAndroidModule1.AndroidModule1JNIPrompt(Sender: TObject);
  2. begin
  3.   Self.SetScreenOrientationStyle(ssPortrait);
  4. end;

shyub

  • Full Member
  • ***
  • Posts: 144
Re: Error after adding an icon.
« Reply #2 on: May 05, 2024, 12:34:29 pm »
I wrote a small utility "ResLAMW" that allows you to create icons and place them in project resources. I am attaching the project files to the message. To compile, you need to install BGRA components. Help on screen resolution in Russian, you can translate it into your native language.

 

TinyPortal © 2005-2018