locked
DrawText is wrong size on QVGA devices RRS feed

  • Question

  • I have a program developed in eVC4 which displays some text using DrawText.

    The text displays properly on all devices except for QVGA running Windows Mobile 5.0 and later. On these devices, the text is displayed at double the proper size. It does displays correctly on all VGA devices, as well as before WM 5.

    The code is identical on all platforms. Hi Res is not enabled.

    Any ideas?
    Wednesday, September 9, 2009 5:25 PM

Answers

  • Problem found. There was some code which improperly calculated the text font size, which has now been corrected.

    Thanks to all who participated!
    • Marked as answer by George Henne Friday, September 11, 2009 10:03 AM
    Friday, September 11, 2009 10:03 AM

All replies

  • Check the font size You're setting. It must be Your omission.
    If You'll find my answer satisfactory or helpful - mark it as answered or vote for it! Thank You.
    "If You think You know better then me, why is Your code not working, then don't waste my time at this forum. Otherwise - do as I'm suggesting."
    Wednesday, September 9, 2009 5:27 PM
  • I'm setting the font size explicitly. The same code is being executed on all devices.
    Wednesday, September 9, 2009 5:33 PM
  • What makes you think the size is wrong? If the device is high DPI, the size will be larger for the same given font size.
    Controls for WPF, Windows Forms and Silverlight at http://www.divelements.co.uk
    Wednesday, September 9, 2009 5:48 PM
  • As well as regular devices, I see this on the emulator as well. The emulators all run the same DPI size. 
    Wednesday, September 9, 2009 5:52 PM
  • No they are not!
    QVGA devices/emulators use 96 DPI and VGA devices use 192 DPI, also 320x320 pixel screens with 128 DPI exist.

    That means you need to specify a twice as big font size on VGA as on QVGA to get the same size because the have double the resolution.

    Check out this tutorials for more information:
    http://msdn.microsoft.com/en-us/library/ms838191.aspx
    and
    http://msdn.microsoft.com/en-us/library/bb431779.aspx

    • Proposed as answer by MSWiege Wednesday, September 9, 2009 6:33 PM
    Wednesday, September 9, 2009 6:33 PM
  • The emulators display at the resolution of the monitor. The size of the VGA emulator is 4 times the size of the VGA emulator when displayed on the screen. I am not comparing the size of the actual text between the QVGA and VGA emulators: I am comparing the size relative to the emulator.

    On the VGA screen, the text "Courier New 20" stretches the full width. On the QVGA, it only goes about half way.

    If the DPI was the explanation, I'd expect it to be the other way around: the QVGA text would be (relatively) larger than the VGA.

    I'm not in hi res mode. I'm running in legacy mode, where the emulation layer should hide the difference in dpi, automatically rescaling to 240x320.

    [Re reading my original post: I made a significant error: instead of "double", it should have read "half". The correct sentence is as follows:
    "The text displays properly on all devices except for QVGA running Windows Mobile 5.0 and later. On these devices, the text is displayed at half the proper size. It does displays correctly on all VGA devices, as well as before WM 5."
    Please accept my apologies for the confusion this has caused!]
    Wednesday, September 9, 2009 6:59 PM
  • Problem found. There was some code which improperly calculated the text font size, which has now been corrected.

    Thanks to all who participated!
    • Marked as answer by George Henne Friday, September 11, 2009 10:03 AM
    Friday, September 11, 2009 10:03 AM