개발 110

[이미지] C# Picturebox 내에서 이미지 움직이기

picture 박스보다 큰 이미지를 Picture 박스에 이미지를 불러온뒤 움직이기 using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms; namespace MoveImageOnPictrueBox{ public partial class Form1 : Form { private bool IsClicked = false; private Bitmap bm; private Point recLoc; pri..

개발/C# 2018.02.07

[이미지] C# 이미지위에 다른이미지 올려 마우스로 이동하기

Let the user drag an image with transparent pixels over a background image in C#Posted on September 25, 2014 by Rod StephensThis example shows how you can let the user drag an image on a PictureBox. The PictureBox‘s Image property is set to a background image. The user can press the mouse down on any of the image’s non-transparent pixels to drag the image.When it starts, the program uses the fol..

개발/C# 2018.02.07

[이미지] C# PictureBox 움직이기

PictureBOX를 마우스를 이용해서 이리저리 폼 위에서 옮기기 using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.IO;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms; namespace MoveinPictureBox{ public partial class Form1 : Form { Boolean isPositionCurseurImageSet = false; Point positionCurseurImage = new..

개발/C# 2018.02.07

[팁] C# 프로그램 중복실행 방지

출처 : http://metashower.egloos.com/9468289 해봤는데 제일 아래껏만 제대로 작동됨. Mutex를 이용한 프로세스 통제 실행파일을 여러 번 실행하면 여러 개의 다른 프로세스들이 생성되는데 만약 해당 머시에서 오직 한 프로세스만 실행되도록하길 원한다면, 일반적으로 사용되는 한 방법으로 Mutex를 사용 할 수 있다. Mutex는 프로세스간 동기화 (Sychronization)을 위해 사용되는데, .NET Framework에는 System.Threading.Mutex라는 클래스가 구현되어 있다. //뮤텍스 생성 Mutex m = new Mutex(); //뮤텍스를 획득할 때까지 대기 m.WaitOne(); //뮤텍스 해제 m.ReleaseMutext(); 단일 프로세스만 실행 예..

개발/C# 2018.02.06

[팁] 폼 상단바 클릭 이벤트

폼 상단바.. 그러니까 X있고 최소화 최대화 있는 그곳을 누르면 이벤트를 받고 싶을때 win32 api의 winproc를 쓰면된다. const int WM_NCLBUTTONDOWN = 0x00A1; protected override void WndProc(ref Message m) { base.WndProc(ref m); // no client area if (m.Msg == WM_NCLBUTTONDOWN) { //select tittle area only If (){ this.Cursor = new Cursor(Cursor.Current.Handle); MessageBox.Show("Click"); //} } } 소스코드의 적당한 곳에 붙여넣기 하면 된다.

개발/C# 2018.02.02