Graphics problems - DPI settings!!!!
-
Hi all, i'm developing an application which involves a lot of drawing of lines and shapes, using panels as drawing surfaces. The panels themselves are on pages of a tab control. In addition the panels also contain various labels and combo boxes which are connected by the lines drawn. My problem is that if i change the system settings so that i'm running at 120dpi (instead of 96 std.) the lines and shapes get "scattered" all over the panel and no longer connect the other controls. Is there a way to detect what dpi setting a system is at and apply a transformation to my drawing routines? Any advice or suggestions are welcome Thanks Paul Griffin
-
Hi all, i'm developing an application which involves a lot of drawing of lines and shapes, using panels as drawing surfaces. The panels themselves are on pages of a tab control. In addition the panels also contain various labels and combo boxes which are connected by the lines drawn. My problem is that if i change the system settings so that i'm running at 120dpi (instead of 96 std.) the lines and shapes get "scattered" all over the panel and no longer connect the other controls. Is there a way to detect what dpi setting a system is at and apply a transformation to my drawing routines? Any advice or suggestions are welcome Thanks Paul Griffin
A host of possibilities have run across my brain just now, but I have not taken the time to look up the proper solution. 1) Look through the documentation for the Graphics class and related classes. There is a strong probability that the answer is in there. 2) Modify your drawing routines to use the location of the controls, rather than using preset pixel counts. 3) Compare the positions of two controls that are always present in your application. In one dpi setting, they will have certain locations, while they will have other locations (and sizes) in another dpi setting. With that information, you could pretty much detect the setting (but it may not be reliable, test first). John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek. -
Hi all, i'm developing an application which involves a lot of drawing of lines and shapes, using panels as drawing surfaces. The panels themselves are on pages of a tab control. In addition the panels also contain various labels and combo boxes which are connected by the lines drawn. My problem is that if i change the system settings so that i'm running at 120dpi (instead of 96 std.) the lines and shapes get "scattered" all over the panel and no longer connect the other controls. Is there a way to detect what dpi setting a system is at and apply a transformation to my drawing routines? Any advice or suggestions are welcome Thanks Paul Griffin