전체 글

Andras Town

    _beginthreadex() 예제

    #include #include #include int test_int = 0; // 1번째 Threadunsigned int WINAPI Thread_Function_one(void *avg){std::cout

    C# PictureBox Mouse Move

    private bool click_ = false;private Point click_point_ = new Point();public void PictureBox_MouseDown(object sender, MouseEventArgs e){if (e.Button == MouseButtons.Left && click_ == false){click_ = true;click_point_.X = e.X;click_point_.Y = e.Y;}} public void PictureBox_MouseUp(object sender, MouseEventArgs e){click_ = false;click_point_.X = 0; click_point_.Y = 0;} public void PictureBox_MouseMo..

    C# 절대값

    Point position = new Point();private void Background_MouseDown(object sender, MouseEventArgs e){position.X = e.X;position.Y = e.Y;}private void Background_MouseMove(object sender, MouseEventArgs e){// Size의 크기가 -로 될 수 가 있다.int width = e.X - position.X;int height = e.Y - position.Y;Size size = new Size(width, height);} width와 height는 -값이 나올 수 없으니절대값으로 바꿔주어야 한다.바꾸는 함수는 Math.Abs(); 다음과 같이 바꾸면 된다.in..