Click here to Skip to main content
15,913,944 members
Home / Discussions / WPF
   

WPF

 
Question3 Tangent Ciricles? Pin
jward21-Jul-09 0:55
jward21-Jul-09 0:55 
AnswerRe: 3 Tangent Ciricles? Pin
Michael Sync23-Jul-09 19:43
Michael Sync23-Jul-09 19:43 
QuestionWPF: Windows 7 Taskbar Integration throwing COM Exception Pin
Kunal Chowdhury «IN»21-Jul-09 0:26
professionalKunal Chowdhury «IN»21-Jul-09 0:26 
AnswerRe: WPF: Windows 7 Taskbar Integration throwing COM Exception Pin
#realJSOP21-Jul-09 3:48
professional#realJSOP21-Jul-09 3:48 
GeneralRe: WPF: Windows 7 Taskbar Integration throwing COM Exception Pin
Kunal Chowdhury «IN»21-Jul-09 18:35
professionalKunal Chowdhury «IN»21-Jul-09 18:35 
GeneralRe: WPF: Windows 7 Taskbar Integration throwing COM Exception Pin
Keeron24-Jul-09 7:56
Keeron24-Jul-09 7:56 
GeneralRe: WPF: Windows 7 Taskbar Integration throwing COM Exception Pin
Kunal Chowdhury «IN»26-Jul-09 19:15
professionalKunal Chowdhury «IN»26-Jul-09 19:15 
QuestionNeed help with positioning 3D models in a viewport Pin
Etienne_12320-Jul-09 23:23
Etienne_12320-Jul-09 23:23 
AnswerRe: Need help with positioning 3D models in a viewport Pin
Pete O'Hanlon20-Jul-09 23:28
mvePete O'Hanlon20-Jul-09 23:28 
QuestionDropdown button with "search" Textbox using C# Pin
Krishna Aditya20-Jul-09 21:31
Krishna Aditya20-Jul-09 21:31 
AnswerRe: Dropdown button with "search" Textbox using C# Pin
Pete O'Hanlon20-Jul-09 23:08
mvePete O'Hanlon20-Jul-09 23:08 
AnswerRe: Dropdown button with "search" Textbox using C# Pin
Krishna Aditya20-Jul-09 23:39
Krishna Aditya20-Jul-09 23:39 
QuestionTreeview Expansion in MVVM Pin
VickyC#20-Jul-09 21:19
VickyC#20-Jul-09 21:19 
AnswerRe: Treeview Expansion in MVVM Pin
Michael Sync23-Jul-09 19:51
Michael Sync23-Jul-09 19:51 
GeneralRe: Treeview Expansion in MVVM Pin
VickyC#16-Aug-09 13:07
VickyC#16-Aug-09 13:07 
QuestionXamlParseException at startup under debug Pin
Gary Wheeler20-Jul-09 9:27
Gary Wheeler20-Jul-09 9:27 
AnswerRe: XamlParseException at startup under debug Pin
Mark Salsbery21-Jul-09 7:40
Mark Salsbery21-Jul-09 7:40 
GeneralRe: XamlParseException at startup under debug Pin
Gary Wheeler21-Jul-09 7:57
Gary Wheeler21-Jul-09 7:57 
GeneralRe: XamlParseException at startup under debug Pin
Mark Salsbery21-Jul-09 8:53
Mark Salsbery21-Jul-09 8:53 
GeneralRe: XamlParseException at startup under debug Pin
Gary Wheeler21-Jul-09 9:20
Gary Wheeler21-Jul-09 9:20 
GeneralRe: XamlParseException at startup under debug Pin
Mark Salsbery21-Jul-09 9:41
Mark Salsbery21-Jul-09 9:41 
GeneralRe: XamlParseException at startup under debug Pin
Gary Wheeler21-Jul-09 9:52
Gary Wheeler21-Jul-09 9:52 
QuestionHow to get Windows-wide DPI Scaling number within WPF Pin
fjparisIII20-Jul-09 7:47
fjparisIII20-Jul-09 7:47 
Most people use 96 DPI, but occasionally people set this to 120 DPI (or even higher), especially with high resolution monitors that display at greater than 100 DPI. This number is easy to get under Win32 ("LogPixels") and I've done it for years. But I haven't been able to find out what .NET API delivers this number. This is such an important parameter that there must be a simple API to get it under .NET. Does anyone know what it is? This is especially important from Vista onward which doesn't believe in physical pixels, but merely device independent units.

Matthew MacDonald's Pro WPF in C# 2008, chapter 1, has a good discussion of device independent DPI scaling but nowhere does he say how to obtain this crucial number. I need the number because I have to scale the numbers that come back from the monitor enumeration, which specifies, x,y, height, and width, to fill the screen with a bitmap. All these numbers have to be scaled back by a factor 96/x, where x is the DPI Scaling number.

If worse comes to worse, I'll use Interop services to get the number, but I cringe every time I do that, thinking that I've just missed something in .NET.

I've been told how to do this with a .NET Forms application, but I can't find anything comparable for WPF. The suggestion was as follows:

Graphics g = this.CreateGraphics(); 
MessageBox.Show(g.DpiX.ToString() + Environment.NewLine + g.DpiY.ToString());
g.Dispose();
g = null;


I can also get this number from the Registry: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontDPI]"LogPixels" but that's even more of a hack than Interop Services. The cleanest way would be through a .NET API.
AnswerRe: How to get Windows-wide DPI Scaling number within WPF Pin
Ian Shlasko20-Jul-09 10:09
Ian Shlasko20-Jul-09 10:09 
GeneralRe: How to get Windows-wide DPI Scaling number within WPF Pin
fjparisIII20-Jul-09 12:20
fjparisIII20-Jul-09 12:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.