본문 바로가기

[C#]마우스 좌표 얻기 기본적인 좌표는 Control.MousePosition.X Control.MousePosition.Y 이고 이놈을 그대론 절때 못 쓴다. LCD화면의 좌표를 보내주는거 같고 픽스 해야한다. 해당컨트롤놈.PointToClient(new Point(Control.MousePosition.X, Control.MousePosition.Y)); 이렇게 하면 해당컨트롤을 기준으로 마우스 실제 상대좌표가 어딘가 뱉어낸다. 이값은 해당컨트롤.마우스이벤트(MouseArgsEvent e)의 e.X와 같다. 후후. 안그럼 패딩 뺴주고 지랄날리부르스해야한다. 편리하군 PointToClient와 PointToScreen
[C#]디렉토리 안에 폴더 삭제 하기 DirectoryInfo dir = new DirectoryInfo(폴더경로); FileInfo[] files = dir.GetFiles(); foreach(FileINfo F in files) { F.Delete(); } 출처 : Tong - centerkjh님의 Visual C#통 폴더 삭제 하기 * 읽기 전용 파일 포함 디렉토리 삭제 방법 using System.IO; protected void DeleteTempDirectory() { DirectoryInfo tempDirInfo = new DirectoryInfo("temp"); if (tempDirInfo.Exists == true) { foreach (DirectoryInfo di in tempDirInfo.GetDirectories()) ..
[C#] Brushes Color에 정의된 색깔 [펌] http://blog.naver.com/kimwj304/50028455963
[C#]이미지 그릴때 확대해서 그리기 이미지를 그릴 때 확대해서 그리자. g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Bilinear; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; g.DrawImage(image, new Rectangle(x, y, imageWidth*2, imageHeight*2)); image : Bitmap 객체나 Image 객체등. x : 찍힐 좌표 x y : 찍힐 좌표 y imageWidth : 이미지 가로 크기 imageWidth : 이미지 세로 크기 imageWidth*2, imageHeight*2 : 이미지의 두배만큼 x,y에 찍어라.
[C#] 비트맵을 버퍼에 생성할때 배경 투명하게 하기 배경을 투명하게 한다기보담은 특정색을 투명색으로 지정. Bitmap bmp = new Bitmap(w, h); bmp m_Img.MakeTransparent(Color.White);//흰색은 투명처리.
[C#].NET 2005에서 디버깅 오류 C#에서 디버깅(F5) 할때 아래와 같은 메세지를 내 뱉는다면~ 관리도구-서비스-터미널 서비스를 시작시킵시다~ 순간 당황했네. 설치한 XP가 문구녕 버전이라서 왠만한 서비스는 다 꺼져 있어서. 저런 문제가 생기는듯.