This project is read-only.

DPI question

Feb 17, 2011 at 10:35 AM
Edited Feb 17, 2011 at 10:53 AM


 First of all,pl forgive me for my poor english.and i have to say that you are doing a good job and great project.

 My devie is 800*480 pels .and it's DPI is 96(DPIX = 96,DPIY = 96). it is running wince6.0 R2 OS.

 when I run the app(fleux demo),i want to make the UI  suitable for my device(fleux demo is not for 800*480 pels).So,I change the params

 "FleuxApplication.TargetDesignDpi = 96;//192 " in program.cs.

 but i found that the background picture of ui is shown correctly,but y-axis spacing between two text is double than the normal.

 for eg, I use a 800*480 pic to be background,but when i change" FleuxApplication.TargetDesignDpi = 96" in program.cs. some content dispeared ,eg the text "more is coming" is not within the scope that i can see.

so my question is that how can i change the code to make the app'UI  suitable.

thank you~

Feb 17, 2011 at 1:18 PM

The TargetDesignDpi property was intended for setting what was the Dpi you have in mind while designing the app (not necessary where the app will run).

Unfortunately, there are some elements in Fleux (like some styles for the panorama) that are targeting 192 dpi, which makes inconsistent results if you change this value on the FleuxApplication.TargetDesignDpi property. And I'm actually going to remove this property in the next version as it brings more confusion than benefits.

In your particular case, you should leave the TargetDesignDpi = 192, as in the original sample. That should keep fonts and styles the same size as was originally designed. It means that in your device, even with a lower dot density, the graphic elements will have the same physical size than they have in an HD2.

I guess you tried changing this value because you're having some layout issues, and that's not related to the TargetDesignDpi, that's because the form factor and physical screen size you're running the app is very different than the HD2 used for designing it (Let me know if it's just the double width and double height, or it's also landscape?).

In fact, the panorama control has been designed thinking on a portrait 480 * 800 screen, and there are some ugly hardcoded values in PanoramaElement.cs where i.e. the section width is set to 380, that you might need to change if you want wider sections and this 380 for 192 dpi means a 190 pixels section width in your device, and you may want something closer to 480 or maybe 800?

BTW, the PanoramaElement needs some auto layout improvements for different form factors, it works pretty well for typical sized portrait devices, but I know there are many form factors, and yours can be a very good use case.

Hope this helps,