private void button_copyImgToClipboard_Click(object sender, EventArgs e)
{
Bitmap bt = new Bitmap((79)*11,79);
Graphics g = Graphics.FromImage(bt);
Point xp = PointToScreen(new Point(picboxes[0].Location.X,0));
Point yp = PointToScreen(new Point(0, picboxes[0].Location.Y));
//여기서 시작 포지션...그리고 0,0 하고 사이즈 정해주면 그 만큼 캡쳐를함
//이때 좌표를 프로세스 내 좌표를 할 지 스크린 좌표로 할 지 그것만 정하면 됨
g.CopyFromScreen(
xp.X,
yp.Y,
0,//this.Location.X + this.Width,
0,//this.Location.Y + this.Height,
new Size(bt.Width, bt.Height));
//bt.Save(@"test.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
Clipboard.SetImage((Image)bt);
MessageBox.Show("이미지 클립보드 복사 완료");
}
'컴퓨터 과학 & 영상처리 관련 > C# / .NET / JAVA' 카테고리의 다른 글
c# string to string[] newline, string sort (0) | 2014.03.05 |
---|---|
c# 디버그 모드인지 확인하는 소스 #if DEBUG (0) | 2014.03.04 |
c# delegate 예제(c의 함수포인터에 해당하는듯) (0) | 2014.03.02 |
c# int형 변수 문자열 포맷 출력 시 16진수로 보여주고 싶을 때 (0) | 2014.02.28 |
c# 이벤트 발생 시 연돌되는 핸들러 자동 생성 방법 (0) | 2014.02.28 |