Click here to Skip to main content
15,170,331 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: XamlParseException at startup under debug Pin
Mark Salsbery21-Jul-09 9:53
MemberMark Salsbery21-Jul-09 9:53 
GeneralRe: XamlParseException at startup under debug Pin
Gary Wheeler21-Jul-09 10:20
MemberGary Wheeler21-Jul-09 10:20 
GeneralRe: XamlParseException at startup under debug Pin
Mark Salsbery21-Jul-09 10:41
MemberMark Salsbery21-Jul-09 10:41 
GeneralRe: XamlParseException at startup under debug Pin
Gary Wheeler21-Jul-09 10:52
MemberGary Wheeler21-Jul-09 10:52 
QuestionHow to get Windows-wide DPI Scaling number within WPF Pin
fjparisIII20-Jul-09 8:47
MemberfjparisIII20-Jul-09 8:47 
AnswerRe: How to get Windows-wide DPI Scaling number within WPF Pin
Ian Shlasko20-Jul-09 11:09
MemberIan Shlasko20-Jul-09 11:09 
GeneralRe: How to get Windows-wide DPI Scaling number within WPF Pin
fjparisIII20-Jul-09 13:20
MemberfjparisIII20-Jul-09 13:20 
GeneralRe: How to get Windows-wide DPI Scaling number within WPF [SOLVED] Pin
fjparisIII21-Jul-09 12:27
MemberfjparisIII21-Jul-09 12:27 
It does work! The beauty of this solution is that it is device-specific, so if Microsoft ever does get around to supporting individual DPI Scalings per monitor, this code will work without change.

Consider the following code snippet:

// Find out which monitor the ViewerWindow should be on.
_left = Monitor.Rect.left;
_top = Monitor.Rect.top;
_width = Monitor.Width;
_height = Monitor.Height;

// Account for the DPI scaling of this monitor.
Matrix m = PresentationSource.FromVisual(this).CompositionTarget.TransformToDevice;
double dpiX = m.M11;
double dpiY = m.M22;
_left /= dpiX;
_top /= dpiY;
_width /= dpiX;
_height /= dpiY;


The original values of _left, _top, _width and _height are the direct result of the monitor properties of the monitor the code is going to display images on. dpiX and dpiY are then the DPI scaling factors of the X and Y directions of that monitor. for 96 DPI (the standard) the values are 1.0. For 120 DPI, the values are 1.25. So I just scale the four monitor dimensions and Voila! Absolute perfection for this particular monitor.

End of story.
QuestionTrying to understand the logical tree and ItemsControl problem Pin
Super Lloyd20-Jul-09 4:19
MemberSuper Lloyd20-Jul-09 4:19 
QuestionWPF +WCF Pin
bhavna432120-Jul-09 2:51
Memberbhavna432120-Jul-09 2:51 
AnswerRe: WPF +WCF Pin
Kunal Chowdhury «IN»20-Jul-09 2:56
professionalKunal Chowdhury «IN»20-Jul-09 2:56 
GeneralRe: WPF +WCF Pin
bhavna432120-Jul-09 3:16
Memberbhavna432120-Jul-09 3:16 
GeneralRe: WPF +WCF Pin
Kunal Chowdhury «IN»21-Jul-09 4:01
professionalKunal Chowdhury «IN»21-Jul-09 4:01 
AnswerRe: WPF +WCF Pin
Jammer20-Jul-09 6:34
MemberJammer20-Jul-09 6:34 
AnswerRe: WPF +WCF Pin
Vijaykishan21-Jul-09 1:15
MemberVijaykishan21-Jul-09 1:15 
QuestionHow to make groupbox invisble on select of a radiobutton Pin
Krishna Aditya19-Jul-09 21:34
MemberKrishna Aditya19-Jul-09 21:34 
AnswerRe: How to make groupbox invisble on select of a radiobutton Pin
Kunal Chowdhury «IN»19-Jul-09 22:00
professionalKunal Chowdhury «IN»19-Jul-09 22:00 
AnswerRe: How to make groupbox invisble on select of a radiobutton Pin
#realJSOP20-Jul-09 1:23
mva#realJSOP20-Jul-09 1:23 
QuestionWPF: Is there any Flip Book Control available? Pin
Kunal Chowdhury «IN»19-Jul-09 21:08
professionalKunal Chowdhury «IN»19-Jul-09 21:08 
AnswerRe: WPF: Is there any Flip Book Control available? Pin
Pete O'Hanlon19-Jul-09 23:18
mvaPete O'Hanlon19-Jul-09 23:18 
QuestionDeriving new class [modified] Pin
#realJSOP18-Jul-09 3:08
mva#realJSOP18-Jul-09 3:08 
QuestionWPF Call to WCF Service - Sessions? Pin
jeremyadell17-Jul-09 15:47
Memberjeremyadell17-Jul-09 15:47 
AnswerRe: WPF Call to WCF Service - Sessions? Pin
Mark Salsbery18-Jul-09 8:09
MemberMark Salsbery18-Jul-09 8:09 
GeneralRe: WPF Call to WCF Service - Sessions? Pin
jeremyadell18-Jul-09 10:57
Memberjeremyadell18-Jul-09 10:57 
GeneralRe: WPF Call to WCF Service - Sessions? Pin
Mark Salsbery18-Jul-09 17:59
MemberMark Salsbery18-Jul-09 17:59 

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.