diff options
author | Niraj Modi | 2016-04-20 12:16:41 +0000 |
---|---|---|
committer | Niraj Modi | 2016-04-20 12:16:41 +0000 |
commit | 9fa023ca5c273cb706c1976b89805d6faed48b9a (patch) | |
tree | cb475ebc77677ffbdc83ce136e4f012a4d4b6fa0 /features | |
parent | 1d989716b4f7b6da00b68ea0dadf54c4f1e34a38 (diff) | |
download | rt.equinox.framework-9fa023ca5c273cb706c1976b89805d6faed48b9a.tar.gz rt.equinox.framework-9fa023ca5c273cb706c1976b89805d6faed48b9a.tar.xz rt.equinox.framework-9fa023ca5c273cb706c1976b89805d6faed48b9a.zip |
Bug 489714 - [Hidpi][Win32] Splash screen getting cropped for higher
zoom values like 150%/200%.
Change-Id: I30b1f6741c4e422d3b84da706fa30d3b8e516453
Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
Diffstat (limited to 'features')
-rw-r--r-- | features/org.eclipse.equinox.executable.feature/library/win32/eclipse.exe.manifest | 7 | ||||
-rw-r--r-- | features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c | 23 |
2 files changed, 28 insertions, 2 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/library/win32/eclipse.exe.manifest b/features/org.eclipse.equinox.executable.feature/library/win32/eclipse.exe.manifest index dda153470..b0864e2ab 100644 --- a/features/org.eclipse.equinox.executable.feature/library/win32/eclipse.exe.manifest +++ b/features/org.eclipse.equinox.executable.feature/library/win32/eclipse.exe.manifest @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"> <assemblyIdentity version="3.1.0.0" processorArchitecture="*" name="Eclipse Launcher" type="win32"/> <description>Standard Widget Toolkit</description> <dependency> @@ -7,5 +7,10 @@ <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/> </dependentAssembly> </dependency> + <asmv3:application> + <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"> + <ms_windowsSettings:dpiAware xmlns:ms_windowsSettings="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</ms_windowsSettings:dpiAware> + </asmv3:windowsSettings> + </asmv3:application> </assembly>
\ No newline at end of file diff --git a/features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c b/features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c index 475dbf0f7..4af33336c 100644 --- a/features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c +++ b/features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -203,6 +203,7 @@ int showSplash( const _TCHAR* featureImage ) int depth; int x, y; int width, height; + int dpiX, scaledWidth, scaledHeight; if(splashing) { /*splash screen is already showing, do nothing */ @@ -219,6 +220,11 @@ int showSplash( const _TCHAR* featureImage ) /* Load the bitmap for the feature. */ hDC = GetDC( NULL); depth = GetDeviceCaps( hDC, BITSPIXEL ) * GetDeviceCaps( hDC, PLANES); + + /* fetch screen DPI and round it to closest 25% interval(25% of 96 is 24) */ + dpiX = GetDeviceCaps ( hDC, LOGPIXELSX ); + dpiX = ((int)(dpiX / 24.f + 0.5)) * 24; + ReleaseDC(NULL, hDC); if (featureImage != NULL) hBitmap = LoadImage(NULL, featureImage, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); @@ -229,6 +235,21 @@ int showSplash( const _TCHAR* featureImage ) GetObject(hBitmap, sizeof(BITMAP), &bmp); + /* reload scaled up image when zoom > 100% */ + if (dpiX > 96.f) { + /* calculate scaled-up bounds */ + scaledWidth = dpiX * bmp.bmWidth / 96.f; + scaledHeight = dpiX * bmp.bmHeight / 96.f; + + hBitmap = LoadImage(NULL, featureImage, IMAGE_BITMAP, scaledWidth, scaledHeight, LR_LOADFROMFILE); + + /* If the bitmap could not be found, return an error. */ + if (hBitmap == 0) + return ERROR_FILE_NOT_FOUND; + + GetObject(hBitmap, sizeof(BITMAP), &bmp); + } + /* figure out position */ width = GetSystemMetrics (SM_CXSCREEN); height = GetSystemMetrics (SM_CYSCREEN); |