locked
DPI setting on Wondows CE 6.0 RRS feed

  • Question

  • Hello! How can I change DPI on Windows CE 6.0 ??? I could't find information about this theme...
    Tuesday, June 14, 2011 9:34 AM

Answers

  • AFAIK Unlike windows Mobile, windows CE 6.0 doesn't have an option to change the DPI.
    Vinoth.R http://vinoth-vinothblog.blogspot.com http://www.e-consystems.com
    • Proposed as answer by Jesse Jiang Thursday, June 16, 2011 9:15 AM
    • Marked as answer by Jesse Jiang Tuesday, June 28, 2011 8:27 AM
    Tuesday, June 14, 2011 9:46 AM

All replies

  • AFAIK Unlike windows Mobile, windows CE 6.0 doesn't have an option to change the DPI.
    Vinoth.R http://vinoth-vinothblog.blogspot.com http://www.e-consystems.com
    • Proposed as answer by Jesse Jiang Thursday, June 16, 2011 9:15 AM
    • Marked as answer by Jesse Jiang Tuesday, June 28, 2011 8:27 AM
    Tuesday, June 14, 2011 9:46 AM
  • But may be it can change in the registry???
    Tuesday, June 14, 2011 10:34 AM
  • AFAIK Unlike windows Mobile, windows CE 6.0 doesn't have an option to change the DPI.
    Vinoth.R http://vinoth-vinothblog.blogspot.com http://www.e-consystems.com

    Hi Vinoth, 

    How can I change the DPI in Windows Mobile 6.5? I cannot find any setting in the Setting Panel ~~~

     

     

    Thank you ~~~

     

    Jessie

    Friday, November 11, 2011 6:23 AM
  • AFAIK you can change DPI settings only during the OS binary image building. you can't change through control panel settings.

     


    Vinoth.R http://vinoth-vinothblog.blogspot.com http://www.e-consystems.com
    Friday, November 11, 2011 8:20 AM
  • public class DpiHelper
        {
            /// <summary>The real dpi of the device.</summary>
            private static int dpi = SafeNativeMethods.GetDeviceCaps(IntPtr.Zero, /*LOGPIXELSX*/88);
            /// <summary>Adjust the sizes of controls to account for the DPI of the device.</summary>
            /// <param name="parent">The parent node of the tree of controls to adjust.</param>
            public static void AdjustAllControls(Control parent)
            {
                if (dpi == 96)
                    return;
                foreach (Control child in parent.Controls)
                {
                    
                    if (child.Name.EndsWith("DataGrid"))
                    {
                        AdjustControl(child);
                    }
                    else
                    {
                        AdjustControl(child);
                        AdjustAllControls(child);
                    }
                }
            }
            public static void AdjustControl(Control control)
            {
                control.Bounds = new Rectangle(
                      control.Left * dpi / 96,
                      control.Top * dpi / 96,
                      control.Width * dpi / 96,
                      control.Height * dpi / 96);
            }
            /// <summary>Scale a coordinate to account for the dpi.</summary>
            /// <param name="x">The number of pixels at 96dpi.</param>
            public static int Scale(int x)
            {
                return x * dpi / 96;
            }
            public static int getScaleRatio()
            {
                return dpi / 96;
            }
            private class SafeNativeMethods
            {
                [DllImport("coredll.dll")]
                static internal extern int GetDeviceCaps(IntPtr hdc, int nIndex);
            }
        }
    //Implement this on form load
    DpiHelper.AdjustAllControls(this);
    This should work, Let me know if you have any issues.

    Sridhar
    • Proposed as answer by Jessie Wei Tuesday, November 15, 2011 11:15 PM
    Friday, November 11, 2011 2:40 PM
  • Thank you, Sridhar~~~

    I have tried this way ~~~

    but our application has too many customized rendered components such message box, progress bar and transparent images with transparency colour~~~ if we use this way, we need to spend a lot of time to adjust this components and images ~~~

    So the best way is to find a way to disable high DPI and to use the standard DPI ~~~

    but according to Vinoth's suggest, it seems we cannot adjust DPI setting during control panel setting~~~ 

    Thank you, Vinoth ~~~

     

    Jessie

    Tuesday, November 15, 2011 11:22 PM
  • try urControl.height = DpiHelper.Scale(urControl.Height); or DpiHelper.AdjustControl(control);
    Sridhar
    Wednesday, November 16, 2011 8:53 AM
  • On Tue, 14 Jun 2011 09:34:35 +0000, zMotoR wrote:

    Hello! How can I change DPI on Windows CE 6.0 ??? I could't find information about this theme...

    If I want my app to run at high resolution, I include the following line in its resource
    (.rc) file:
    "HI_RES_AWARE" CEUX {1}
    So maybe you can find this in generated files and then remove it.

    I found out about this from an article called "Developing DPI-Aware Applications":

    http://msdn.microsoft.com/msdn-online/shared/components/ratings/ratings.aspx?ContentID=_1049345&HideDiscuss=1
    // 22 Apr 05 (7.7.0.28)
    NOTE: URL is mangled by line-splitter.

    Thursday, November 17, 2011 8:32 PM
  • Unfortunately, this page does not exist :(
    Sunday, November 20, 2011 3:43 PM
  • On Sun, 20 Nov 2011 15:43:12 +0000, zMotoR wrote:

    Unfortunately, this page does not exist :(

    Did you try looking through the resource (.rc) files for your project to see whether any
    contain HI_RES_AWARE?

    I just went to www.microsoft.com, searched for HI_RES_AWARE, and got several links that
    look useful, although only you can really tell.

    (I haven't checked here for a while; getting ready for and enjoying Thanksgiving.)

    Friday, November 25, 2011 8:54 PM
  • I red about HI_RES_AWARE here: http://msdn.microsoft.com/en-us/library/bb416287.aspx

    It's using only with Windows Mobile Professional and Windows Mobile Classic :(

    But I have a Windows CE 6.0 device.

    Monday, November 28, 2011 12:14 PM
  • On Mon, 28 Nov 2011 12:14:00 +0000, zMotoR wrote:

    I red about HI_RES_AWARE here: http://msdn.microsoft.com/en-us/library/bb416287.aspx

    It's using only with Windows Mobile Professional and Windows Mobile Classic :(

    But I have a Windows CE 6.0 device.

    The documentation isn't always right, and a slim chance is better than none. So I was
    suggesting you look at your files. Look for files with a .rc extension and then look in
    them to see whether they include the HI_RES_AWARE flag. If you're lucky, you'll find one
    and removing it will solve your problem.

    Wednesday, November 30, 2011 10:40 PM
  • The documentation isn't always right, and a slim chance is better than none. So I was

    suggesting you look at your files. Look for files with a .rc extension and then look in
    them to see whether they include the HI_RES_AWARE flag. If you're lucky, you'll find one
    and removing it will solve your problem.

    I was looking for what you said. But I can't find HI_RES_AWARE flag :(

    Thank you for the advice.

    Thursday, December 1, 2011 10:55 AM
  • On Thu, 1 Dec 2011 10:55:05 +0000, zMotoR wrote:

    The documentation isn't always right, and a slim chance is better than none. So I was

    suggesting you look at your files. Look for files with a .rc extension and then look in
    them to see whether they include the HI_RES_AWARE flag. If you're lucky, you'll find one
    and removing it will solve your problem.

    I was looking for what you said. But I can't find HI_RES_AWARE flag :(

    So it seems folks who said WM 6 supports only high resolution are right.


    Thank you for the advice.

    You're welcome. I'm sorry I didn't actually help.

    Tuesday, December 6, 2011 6:47 PM