Click here to Skip to main content
15,890,995 members
Home / Discussions / WPF
   

WPF

 
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 
GeneralRe: How to get Windows-wide DPI Scaling number within WPF [SOLVED] Pin
fjparisIII21-Jul-09 11:27
fjparisIII21-Jul-09 11:27 
QuestionTrying to understand the logical tree and ItemsControl problem Pin
Super Lloyd20-Jul-09 3:19
Super Lloyd20-Jul-09 3:19 
QuestionWPF +WCF Pin
bhavna432120-Jul-09 1:51
bhavna432120-Jul-09 1:51 
AnswerRe: WPF +WCF Pin
Kunal Chowdhury «IN»20-Jul-09 1:56
professionalKunal Chowdhury «IN»20-Jul-09 1:56 
GeneralRe: WPF +WCF Pin
bhavna432120-Jul-09 2:16
bhavna432120-Jul-09 2:16 
GeneralRe: WPF +WCF Pin
Kunal Chowdhury «IN»21-Jul-09 3:01
professionalKunal Chowdhury «IN»21-Jul-09 3:01 
AnswerRe: WPF +WCF Pin
Jammer20-Jul-09 5:34
Jammer20-Jul-09 5:34 
AnswerRe: WPF +WCF Pin
Vijaykishan21-Jul-09 0:15
Vijaykishan21-Jul-09 0:15 
QuestionHow to make groupbox invisble on select of a radiobutton Pin
Krishna Aditya19-Jul-09 20:34
Krishna Aditya19-Jul-09 20:34 
AnswerRe: How to make groupbox invisble on select of a radiobutton Pin
Kunal Chowdhury «IN»19-Jul-09 21:00
professionalKunal Chowdhury «IN»19-Jul-09 21:00 
AnswerRe: How to make groupbox invisble on select of a radiobutton Pin
#realJSOP20-Jul-09 0:23
mve#realJSOP20-Jul-09 0:23 
QuestionWPF: Is there any Flip Book Control available? Pin
Kunal Chowdhury «IN»19-Jul-09 20:08
professionalKunal Chowdhury «IN»19-Jul-09 20:08 
AnswerRe: WPF: Is there any Flip Book Control available? Pin
Pete O'Hanlon19-Jul-09 22:18
mvePete O'Hanlon19-Jul-09 22:18 
QuestionDeriving new class [modified] Pin
#realJSOP18-Jul-09 2:08
mve#realJSOP18-Jul-09 2:08 
QuestionWPF Call to WCF Service - Sessions? Pin
jeremyadell17-Jul-09 14:47
jeremyadell17-Jul-09 14:47 

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.