'windows 해상도'에 해당되는 글 1건

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

C#에서 윈도우즈의 해상도를 가져오는 방법은 다음과 같다.

1. 

Screen.PrimaryScreen.Bounds.Width
Screen.PrimaryScreen.Bounds.Height

 

2.

System.Windows.Forms.SystemInformation.VirtualScreen.Width;

System.Windows.Forms.SystemInformation.VirtualScreen.Height;


이를 이용해 폼을 윈도우즈의 정중앙에 띄울수 도 있다.

 

this.Location = new Point(

   Screen.PrimaryScreen.Bounds.Width/2 - this.Size.Width/2,

   Screen.PrimaryScreen.Bounds.Height/2 - this.Size.Height/2

); 

 
1, 2 의 차이점은 듀얼모니터를 쓸경우 1은 모니터 1대의 해상도를 가져오고 2는 2대를 합한 총 해상도를 가져옵니다.


블로그 이미지

By훈트

,