Can anyone tell px:fp ratio or code to convert fp to px.
I am building a HarmonyOS application and I want to set the width of a component to 20fp and setWidth(int width) takes width in px.
Button button = new Button(getContext());
button.setWidth(width);
Create the query with harmonyos tag in stackoverflow and share the link here:
Developer Platform: Windows
DevEco Studio version: 2.1.0.501
SDK API version: 5
SDK version: 2.1.1.21
Device: Not required
Device OS version: Not required
Describe the query
Can anyone tell px:fp ratio or code to convert fp to px. I am building a HarmonyOS application and I want to set the width of a component to 20fp and
setWidth(int width)
takes width in px.Create the query with harmonyos tag in stackoverflow and share the link here:
**** https://stackoverflow.com/questions/68587533/how-much-1px-is-with-respect-to-fp-in-harmony-os
Additional information
Developer Platform: Windows DevEco Studio version: 2.1.0.501 SDK API version: 5 SDK version: 2.1.1.21 Device: Not required Device OS version: Not required
Regards, Alpesh